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

Re: Revert option for git add --patch

From
JMJonathon Mah <jmah@me.com>
Date
Nov 8, 2012, 08:57 UTC
Message-ID
<EE89F0A1-1C07-4597-B654-035F657AD09F@me.com>
Nathan,
I find myself performing similar actions to you: using git add -p to stage hunks, sometimes editing the staged patch; and keeping mental notes of things I wanted to revert, sometimes changing them in the editor in another window, and sometimes reverting them after the add session with git checkout -p).
The interactive staging-and-editing tool could be improved, but I'm not sure that tool should be called 'git add -p'. git add doesn't touch the working tree — at least I hope not, because I wouldn't expect it.
But I eagerly support more discussion. If someone does want to add this feature to "git add -p" (or named differently), I'll add a request for another letter (perhaps '!')  to edit the hunk in the working tree.
	

Jonathon Mah me@JonathonMah.com

Next: Nguyen Thai Ngoc Duy
Message 1 of 5 in “Re: Revert option for git add --patch”
  1. Jonathon MahNov 8, 2012
  2. Nguyen Thai Ngoc DuyNov 8, 2012
  3. Jeff KingNov 8, 2012
  4. BogoliskNov 9, 2012
  5. Jeff KingNov 8, 2012

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.