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

Re: Feature suggestion: new 'git add -i' command to discard working copy changes

From
EDEvan Driscoll <driscoll@cs.wisc.edu>
Date
Dec 18, 2012, 22:10 UTC
Message-ID
<50D0E9DA.1020408@cs.wisc.edu>
In-Reply-To
<20121218215914.GB1806@sigill.intra.peff.net>
On 12/18/2012 03:59 PM, Jeff King wrote:
> I always assumed nobody really used the full "add -i", but maybe it is
> because I am such a command-line snob. Evan, are you after hunk
> selection (like choosing "patch" from the interactive UI), or full path
> selection?
Mostly the latter.

I have two use cases of 'add -i'. The more common one is if I kind of want -p but don't want to do it for every file. (I guess in part this is my way of substituting for not knowing all the actions during -p as well.) But I sometimes use it if I want to stage several but not all files, as it's often faster for me to just choose the files I want from the interactive add's list than it is for me to type each of the files that I want (even with tab completion) -- I'm often working in a project with unfortunately-deep paths.

What I want for my 'discard' action is more like the latter: I'd like a fast way to choose a file(s) to discard without having to type the path(s).

Maybe I should just investigate tig or another front end; that might satisfy my desire.

Evan
Previous: Jeff KingNext: Jeff King
Message 4 of 5 in “Feature suggestion: new 'git add -i' command to discard working copy changes”
  1. Evan DriscollDec 18, 2012
  2. Junio C HamanoDec 18, 2012
  3. Jeff KingDec 18, 2012
  4. Evan DriscollDec 18, 2012
  5. Jeff KingDec 18, 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.