[U-Boot] [PATCH v2] AT91SAM9XE add embedded flash support

Andreas Bießmann andreas.devel at googlemail.com
Mon Aug 9 09:28:25 CEST 2010


Dear Reinhard Meyer,

Am 09.08.2010 09:08, schrieb Reinhard Meyer:
> Andreas Bießmann schrieb:
> Dear Andreas Bießmann,
>>> So, simple question: how do I get a new patch against the original
>>> state after editing the file?
>> 'git rebase' does the trick, e.g. 'git checkout <my patch branch> && git
>> rebase master'
> 
> Here the problem starts... I have made changes to like 2 dozen files
> since then. I cannot switch branches, nor will a rebase work.

No problem, so how about:
 1. git checkout master && git pull
 2. git checkout -b my_branch_for_single_commit
 3. git cherry-pick <hash of commit in question>
 4. fix conflicts, make changes a.s.o.
 5. generate clean commit on top of current master as already described
 6. git format-patch ....
 7. git checkout master && git branch -d my_branch_for_single_commmit

> I do not want to ADD and COMMIT those changes yet, so I guess I am stuck
> in that branch for the time being.

Ah, i see ... you have uncommited changes in your current branch? Bad
thing!

> Maybe my approach is wrong?

Consider creating a branch for each task you want to e.g. my_test_task1,
my_test_task2. Use git to switch between them (checkout) and get changes
from one branch to another (cherry-pick/merge). These test branches are
cheap to create and delete. Btw it is ok to switch between branches with
uncommited changes. You can e.g. switch, commit there and switch back.

Consider using a branch for patches to go upstream. You can switch to
this branch every time you have to do changes in your patches. Use 'git
rebase origin/master' to stay up to date. Then your local commits will
be replaced by the one in upsteream (they have different hashes!) ..
maybe 'git merge' will also work.

Consider generating small commits (small in means of timeline of
feature). They are so easy to cherry-pick/squash in other branches ...
Git is built to do rework of single commits up to the perfect one ;)


regards

Andreas Bießmann


More information about the U-Boot mailing list