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

Re: [PATCH] git-add: introduce --edit (to edit the diff vs. the index)

From
Sverre Rabbelier <srabbelier@gmail.com>
Date
Apr 13, 2009, 16:59 UTC
Message-ID
<fabb9a1e0904130959y20ff66a8la426f33dc0a9bf8b@mail.gmail.com>
In-Reply-To
<alpine.DEB.1.00.0904131817160.10279@pacific.mpi-cbg.de>
Heya,

On Mon, Apr 13, 2009 at 18:19, Johannes Schindelin <Johannes.Schindelin@gmx.de> > Would not a much saner way be

Show 9 quoted lines
>
>        $ git reset HEAD^
>        $ git add -p
>        $ git stash save --keep-index
>        # test it
>        $ git commit
>        $ git stash apply
>        # test again
>        $ git commit

That's what I do already, but now imagine that at the # test it step I notice that I staged too much, or need to tweak some value only in this commit (e.g., change test_expect_success to test_expect_failure because this commit is the test that indicates the failure, and the next one will fix it and flip from expect_failure to expect_success). At the moment I have to make the change in my working directory (which potentially involved deleting a lot of hunks), stage that and _then_ make my commit. With 'git add -e' I can make the fix and happily continue.

-- 
Cheers,

Sverre Rabbelier
Previous: Johannes SchindelinNext: Ping Yin
Message 9 of 11 in “git-add: introduce --edit (to edit the diff vs. the index)”
  1. git-add: introduce --edit (to edit the diff vs. the index)Johannes Schindelin, Apr 8, 2009
  2. Sverre RabbelierApr 8, 2009
  3. Ping YinApr 9, 2009
  4. Ping YinApr 10, 2009
  5. Ping YinApr 10, 2009
  6. Johannes SchindelinApr 10, 2009
  7. Sverre RabbelierApr 10, 2009
  8. Johannes SchindelinApr 13, 2009
  9. Sverre RabbelierApr 13, 2009
  10. Ping YinApr 11, 2009
  11. Johannes SchindelinApr 13, 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.