Re: [PATCH] filter-branch: add an example how to add ACKs to a range of commits
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:16
Johannes Schindelin [off-list ref] 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.