git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] filter-branch: add an example how to add ACKs to a range of commits

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 17, 2009, 23:12 UTC
Message-ID
<7v8whim3v9.fsf@alter.siamese.dyndns.org>
In-Reply-To
<34cc046b42b5a67bb1c926709bcd1163d1d2faf6.1250541493u.git.johannes.schindelin@gmx.de>
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.
Previous: Johannes Schindelin
Message 2 of 2 in “filter-branch: add an example how to add ACKs to a range of commits”
  1. filter-branch: add an example how to add ACKs to a range of commitsJohannes Schindelin, Aug 17, 2009
  2. Junio C HamanoAug 17, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.