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

Re: Can we make interactive add easier to use?

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Oct 14, 2016, 13:46 UTC
Message-ID
<vpqfunz2gc9.fsf@anie.imag.fr>
In-Reply-To
<CAHd499AnuVximRgM0MKdq5JC-hwkrhox6bK_KA+XGrawoz2W+g@mail.gmail.com>
Robert Dailey <rcdailey.lists@gmail.com> writes:
Show 12 quoted lines
> Normally when I use interactive add, I just want to add files to the
> index via simple numbers, instead of typing paths. So I'll do this as
> quick as I can:
>
> 1. Type `git add -i`
> 2. Press `u` after prompt appears
> 3. Press numbers for the files I want to add, ENTER key
> 4. ENTER key again to go back to main add -i menu
> 5. Press `q` to exit interactive add
> 6. Type `git commit`
>
> This feels very tedious. Is there a simplified workflow for this?
My workflow is to ... not use "git add -i" ;-).

To add patch hunks individually, "git add -p" jumps directly to the "patch" inner loop of "git add -i".

To add whole individual files, a plain "git add" using zsh's smart completion (autocompletes only files for which "git add" is not a no-op), or globs.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Robert DaileyNext: Jeff King
Message 2 of 3 in “Can we make interactive add easier to use?”
  1. Robert DaileyOct 14, 2016
  2. Matthieu MoyOct 14, 2016
  3. Jeff KingOct 14, 2016

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.