ofbiz-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Heath <doo...@brainfood.com>
Subject omg, more git magics
Date Wed, 06 Jan 2010 17:50:32 GMT
God, I just love git.  Just ran into another *wonderful* feature.

Here at brainfood, we use debian.  As such, we make use of the debian
packaging to deploy ofbiz to our servers.  To provide for that, I have
a branch of ofbiz that I made against head back in september, then I
cherry-pick patches from trunk as we see fit.

Yesterday, I was going thru all the changes in december,
cherry-picking several patches.  After I was all done, I then ran a
compile.  Wouldn't you know it, one of the changes didn't work.  This
was because it added a UtilValidate call, but not an import of
UtilValidate(most likely because some earlier commit that I didn't
cherry-pick already had added the import).  So, now I needed to fix
this problem.  The issue, is that the commit was *not* the last one,
but 9 commits old.  So, ...

git rebase -i HEAD~10, launches vim with:
pick 3373962 Remove duplicate webslinger-base-invoker libs ...
pick 7aee368 I noticed during test runs that the same eca ...
pick d3a6532 Merge birt branch 831204:886087 and 831209:885099. ...
pick ac2d9b6 Ignore birt/build
pick 897ffb2 Fix groovy class parsing/caching.
pick f64071b Although we do not experience compile problems ...
pick b7dc3d7 Applied patch from OFBIZ-3358, form ...
pick 181a272 too many files copied over from the addbirt ...
pick 35d9560 Utility methods for reading strings from streams ...

I then changed the second line to say 'edit' instead of 'pick', then
saved the file.

Git replayed all those changes to the 7aee368 commit, then told me to
edit any files I needed to.  I then ran git add to add them to the git
index.  git commit --amend altered the commit, allowing me to add the
missing import line.

Finally, git rebase --continue altered all the *other* commits that
sat on top of the broken one, optionally updating any patches that may
have merge conflicts(it's *very* smart at this).

So now I have a working tree, without this compile error, and the
proper fix is actually in the right commit, instead of being yet
another commit at the head.

This just makes me oh so happy.

View raw message