{"thread":{"id":"20644","subject":"[PATCH] filter-branch: add an example how to add ACKs to a range of commits","startedAt":"2009-08-17T20:38:46Z","lastAt":"2009-08-17T23:12:42Z","messageCount":2,"participants":["Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"120980","messageId":"34cc046b42b5a67bb1c926709bcd1163d1d2faf6.1250541493u.git.johannes.schindelin@gmx.de","threadId":"20644","inReplyTo":"cover.1250541493u.git.johannes.schindelin@gmx.de","subject":"[PATCH] filter-branch: add an example how to add ACKs to a range of commits","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-08-17T20:38:46Z","receivedAt":"2009-08-17T20:38:46Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"When you have to add certain lines like ACKs (or for that matter,\nSigned-off-by:s) to a range of commits starting with HEAD, you might\nbe tempted to use 'git rebase -i -10', but that is a waste of your\ntime.\n\nIt is better to use 'git filter-branch' with an appropriate message\nfilter, and this commit adds an example how to do so to\nfilter-branch's man page.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Documentation/git-filter-branch.txt |   10 ++++++++++\n 1 files changed, 10 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex ab527b5..32ea856 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -305,6 +305,16 @@ range in addition to the new branch name.  The new branch name will\n point to the top-most revision that a 'git-rev-list' of this range\n will print.\n \n+If you need to add 'Acked-by' lines to, say, the last 10 commits (none\n+of which is a merge), use this command:\n+\n+--------------------------------------------------------\n+git filter-branch --msg-filter '\n+\tcat &&\n+\techo \"Acked-by: Bugs Bunny <bunny@bugzilla.org>\"\n+' HEAD~10..HEAD\n+--------------------------------------------------------\n+\n *NOTE* the changes introduced by the commits, and which are not reverted\n by subsequent commits, will still be in the rewritten branch. If you want\n to throw out _changes_ together with the commits, you should use the\n-- \n1.6.4.313.g3d9e3\n"},{"id":"121022","messageId":"7v8whim3v9.fsf@alter.siamese.dyndns.org","threadId":"20644","inReplyTo":"34cc046b42b5a67bb1c926709bcd1163d1d2faf6.1250541493u.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH] filter-branch: add an example how to add ACKs to a range of commits","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-17T23:12:42Z","receivedAt":"2009-08-17T23:12:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> When you have to add certain lines like ACKs (or for that matter,\n> Signed-off-by:s) to a range of commits starting with HEAD, you might\n> be tempted to use 'git rebase -i -10', but that is a waste of your\n> time.\n\nCute.\n\nIn a case like this, I tend to just do:\n\n    git checkout $(git merge-base master js/series)\n\n    git format-patch --stdout master..js/series | git am -s\n\n    git diff js/series\n    git branch --with js/series\n    git branch -f js/series\n\nas the first step (checking out the base, detaching HEAD) and the last\ngroup of steps (verifying what improvements I made while on detached HEAD,\nchecking what _other_ branches may need to be rebuilt, and actually\nupdating the branch) are very common for my every-day branch whipping\nworkflow, and the second case being the full \"format-patch | am\" is just a\nspecial case of what I do regularly, e.g. cherry-picking, manually\nfixing-up, etc.\n\nRebase -i is very nice if you need to dig deep but the change you make is\nactually very limited.  Filter-branch is too automated and requires an\nenormous amount of effort to do anything flexible.  Often I find myself\nwanting to do something in the middle, and I end up doing the \"detach at\nthe base and rebuild\" procedure.\n\nWill apply.  The hint is useful nevertheless.\n"}]}