[U-Boot] Question about patches

Wolfgang Denk
2010-07-20T12:59:38Z

Dear Graeme Russ,

In message <AANLkTilaJ7MVv7VxxreBkCCSzYSZVSqULk_3I5AHlS4s@mail.gmail.com> you wrote:
>
> Now you will have a bunch of commits, but maybe they are in the wrong order
...
> you can then use stg pop/push/merge to re-arrange and merge commits
> together to get them in a more logical arrangement before submitting

With "git rebase -i" I get an editor started like this:

pick 3e9b349 NAND: show manufacturer and device ID for unknown chips
pick 1445f6f NAND: add Toshiba TC58NVG0 identifier
pick bc1a884 mtd: nand_plat: add simple GPIO framework DEV_READY option
pick 67ceefa Blackfin: convert plat-nand code to GPIO framework
pick c9f7351 NAND: environment offset in OOB (CONFIG_ENV_OFFSET_OOB)
pick 53504a2 NAND: formatting cleanups from env.oob support
...
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message

I can reorder, drop, combine (squash), edit patches...

> Sometimes when I'm in the middle of a very long development session I tend
> to end up with one 'big patch' which has multiple logical change units. In
> this case, you can pop the 'big patch', insert a new smaller patch
> implementing some of the 'big patch' then when you push the 'big patch',
> all the duplicate changes are stripped. So you can basically whittle down
> a big, complex commit into multiple smaller commits very easily.

We can use "git add -i" to do this as well. You can even split hunks
to add them to different commits.

> I'm sure you'll argue that this is poor development management, but I
> find myself more efficient if a 'get in the zone' and then go back and
> break things up. It also serves as a really good self imposed code review

No, I don't argue. I'm trying to undestand. I am well aware that there
are many tools for the same tasks, and the most efficient ones are
these you know well, so "vi" is probably much more eficient to me than
your favorite editor is to you. But I always like at least to know
what the tools can do that I don't use or don't know that well -
sometimes - sometimes i's time to make room in the toolbox for a new
tool or another :-)

Thanks!

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Engineering without management is art." - Jeff Johnson