* [PATCH] filter-branch: add an example how to add ACKs to a range of commits [not found] <cover.1250541493u.git.johannes.schindelin@gmx.de> @ 2009-08-17 20:38 ` Johannes Schindelin 2009-08-17 23:12 ` Junio C Hamano 0 siblings, 1 reply; 2+ messages in thread From: Johannes Schindelin @ 2009-08-17 20:38 UTC (permalink / raw) To: git, gitster 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. It is better to use 'git filter-branch' with an appropriate message filter, and this commit adds an example how to do so to filter-branch's man page. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> --- Documentation/git-filter-branch.txt | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index ab527b5..32ea856 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -305,6 +305,16 @@ range in addition to the new branch name. The new branch name will point to the top-most revision that a 'git-rev-list' of this range will print. +If you need to add 'Acked-by' lines to, say, the last 10 commits (none +of which is a merge), use this command: + +-------------------------------------------------------- +git filter-branch --msg-filter ' + cat && + echo "Acked-by: Bugs Bunny <bunny@bugzilla.org>" +' HEAD~10..HEAD +-------------------------------------------------------- + *NOTE* the changes introduced by the commits, and which are not reverted by subsequent commits, will still be in the rewritten branch. If you want to throw out _changes_ together with the commits, you should use the -- 1.6.4.313.g3d9e3 ^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] filter-branch: add an example how to add ACKs to a range of commits 2009-08-17 20:38 ` [PATCH] filter-branch: add an example how to add ACKs to a range of commits Johannes Schindelin @ 2009-08-17 23:12 ` Junio C Hamano 0 siblings, 0 replies; 2+ messages in thread From: Junio C Hamano @ 2009-08-17 23:12 UTC (permalink / raw) To: Johannes Schindelin; +Cc: git Johannes Schindelin <johannes.schindelin@gmx.de> 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. ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-08-17 23:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1250541493u.git.johannes.schindelin@gmx.de>
2009-08-17 20:38 ` [PATCH] filter-branch: add an example how to add ACKs to a range of commits Johannes Schindelin
2009-08-17 23:12 ` Junio C Hamano
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox