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

Re: Revert option for git add --patch

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Nov 8, 2012, 12:00 UTC
Message-ID
<CACsJy8CXV=TPWPkNnF7rPRvuObRH=m6RY0KXVXkCaum1EovDCQ@mail.gmail.com>
In-Reply-To
<EE89F0A1-1C07-4597-B654-035F657AD09F@me.com>
On Thu, Nov 8, 2012 at 3:57 PM, Jonathon Mah <jmah@me.com> wrote:
> 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).

I agree. I'd be really nice to have an interactive command about hunk manipulation between HEAD (or some other ref), index and worktree in both directions (except writing to HEAD, of course). This reminds me of the "git put" discussion a while ago, which also moves code between different locations..

-- 
Duy
Previous: Jonathon MahNext: Jeff King
Message 2 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.