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
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 13, 2009, 16:19 UTC
Message-ID
<alpine.DEB.1.00.0904131817160.10279@pacific.mpi-cbg.de>
In-Reply-To
<fabb9a1e0904101159w7ab19247k81f4b67b8a91198f@mail.gmail.com>
Hi,
On Fri, 10 Apr 2009, Sverre Rabbelier wrote:
Show 12 quoted lines
> On Fri, Apr 10, 2009 at 20:10, Johannes Schindelin 
> <Johannes.Schindelin@gmx.de> > As others have mentioned, there _is_ a 
> reason we have a working directory.
> > Please understand this as a "I do not like the idea of editing the 
> > index directly at all".
> 
> I do not intend use it as a replacement of the working directory, but 
> mostly as a way to split up patches easier. Mainly to _remove_ lines 
> that I staged that I would like to be in a different patch in the series 
> (possibly after doing 'git reset --soft'). I always go through my a 
> longer patch series multiple times until I am satisfied with the result, 
> this addition would make that a lot easier.
Would not a much saner way be
	$ git reset HEAD^
	$ git add -p
	$ git stash save --keep-index
	# test it
	$ git commit
	$ git stash apply
	# test again
	$ git commit
Hmm?

BTW I do not like the "longness" of "git stash save --keep-index"; of course I could install an alias for that, but it feels wrong to have only a cumbersome to call something that should be part of a _lot_ of workflows.

Ciao, Dscho

Previous: Sverre RabbelierNext: Sverre Rabbelier
Message 8 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.