From: Junio C Hamano Date: Mon, 17 Aug 2009 23:12:42 GMT Subject: Re: [PATCH] filter-branch: add an example how to add ACKs to a range of commits Message-ID: <7v8whim3v9.fsf@alter.siamese.dyndns.org> In-Reply-To: <34cc046b42b5a67bb1c926709bcd1163d1d2faf6.1250541493u.git.johannes.schindelin@gmx.de> Johannes Schindelin writes: > When you have to add certain lines like ACKs (or for that matter, > Signed-off-by:s) to a range of commits starting with HEAD, you might > be tempted to use 'git rebase -i -10', but that is a waste of your > time. Cute. In a case like this, I tend to just do: git checkout $(git merge-base master js/series) git format-patch --stdout master..js/series | git am -s git diff js/series git branch --with js/series git branch -f js/series as the first step (checking out the base, detaching HEAD) and the last group of steps (verifying what improvements I made while on detached HEAD, checking what _other_ branches may need to be rebuilt, and actually updating the branch) are very common for my every-day branch whipping workflow, and the second case being the full "format-patch | am" is just a special case of what I do regularly, e.g. cherry-picking, manually fixing-up, etc. Rebase -i is very nice if you need to dig deep but the change you make is actually very limited. Filter-branch is too automated and requires an enormous amount of effort to do anything flexible. Often I find myself wanting to do something in the middle, and I end up doing the "detach at the base and rebuild" procedure. Will apply. The hint is useful nevertheless.