Skip to content

Commit b8f4233

Browse files
dschogitster
authored andcommitted
filter-branch: add an example how to add ACKs to a range of commits
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 13354f5 commit b8f4233

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Documentation/git-filter-branch.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,16 @@ range in addition to the new branch name. The new branch name will
305305
point to the top-most revision that a 'git-rev-list' of this range
306306
will print.
307307

308+
If you need to add 'Acked-by' lines to, say, the last 10 commits (none
309+
of which is a merge), use this command:
310+
311+
--------------------------------------------------------
312+
git filter-branch --msg-filter '
313+
cat &&
314+
echo "Acked-by: Bugs Bunny <[email protected]>"
315+
' HEAD~10..HEAD
316+
--------------------------------------------------------
317+
308318
*NOTE* the changes introduced by the commits, and which are not reverted
309319
by subsequent commits, will still be in the rewritten branch. If you want
310320
to throw out _changes_ together with the commits, you should use the

0 commit comments

Comments
 (0)