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

Re: WANTED: patch splitting tool - waypoints

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
May 2, 2010, 15:17 UTC
Message-ID
<vpqwrvmuycy.fsf@bauges.imag.fr>
In-Reply-To
<20100502115842.GA11607@brong.net>
Bron Gondwana <brong@brong.net> writes:
Show 8 quoted lines
> Hi,
>
> My toolkit is missing a tool.  I've never seen it
> or anything like it, but I can describe it - and
> hopefully someone else knows if it exists.
>
> It's basically a combination of git rebase -i and
> git add -p.
I guess you named it: git add -p.
> So the journey A => B becomes the journey A => W => B.
Just checkout B, then
git reset HEAD^

This will reset your _index_ to the state of A (which happens to be HEAD^, the ancestor of HEAD). Now, you can

while !happy; do
    git add -p   # select patch hunks
    git commit   # Create an intermediate commit
done
git commit -a    # Re-create commit B
Show 5 quoted lines
> The tool allows you to quickly choose which hunks to
> add to patch(A=>W) and which to add to patch(W=>B),
> but also lets you make edits to the intermediate state
> easily so that W will compile even if some bits of the
> patch were intermingled.

Then, "git stash --keep-index" between "git add -p" and "git commit", and "git stash pop" afterwards.

> And a graphical/
> ncurses interface

then, replace "git add -p; git commit" with "git gui", which will let you select hunks and commit from a GUI.

Note that "rebase -i" is not strictly needed here, but you can apply the above flow within a "edit" command of "rebase -i", so it's a nice complement.

-- Matthieu Moy http://www-verimag.imag.fr/~moy/

Previous: Bron GondwanaNext: Matthieu Moy
Message 2 of 7 in “WANTED: patch splitting tool - waypoints”
  1. Bron GondwanaMay 2, 2010
  2. Matthieu MoyMay 2, 2010
  3. Matthieu MoyMay 2, 2010
  4. Bron GondwanaMay 2, 2010
  5. Matthieu MoyMay 3, 2010
  6. Robin RosenbergMay 2, 2010
  7. Yann DirsonMay 3, 2010

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.