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

Re: [RFC PATCH] git add -p: new "quit" command at the prompt.

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Apr 12, 2009, 12:45 UTC
Message-ID
<vpqfxgevy58.fsf@bauges.imag.fr>
In-Reply-To
<7vws9rdmgd.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 11 quoted lines
> Matthieu Moy <Matthieu.Moy@imag.fr> writes:
>
>> There's already 'd' to stop staging hunks in a file, but no command to
>> stop the interactive staging (for the current files and the remaining
>> ones). This patch implements this functionality, and binds it to 'q'.
>> ---
>>
>> I'm not familiar at all with the code in git-add--interactive.perl, so
>> my code is mostly cut-and-pasted+adapted from the 'd' command.
>
> You can say 'd' and then ^C, I think.

Yes, you /can/, and that's what I'm doing right now in this situation. But that's undocumented, not so intuitive (I found out I could do that after trying ^C alone, which doesn't work, staged content is recorded on disk at the end of the file only, not after each prompt), ...

I thought the situation was common enough to deserve an explicit command. The 'd' command is natural for "git add -i" + patch subcommand, but for "git add -p", I found 'd' mostly useless, and I really want a "quit" command.

Sure, I can live without it, but if other people would like to have it, please speak now ;-).

-- 
Matthieu
Previous: Junio C HamanoNext: Sverre Rabbelier
Message 3 of 15 in “git add -p: new "quit" command at the prompt.”
  1. git add -p: new "quit" command at the prompt.Matthieu Moy, Apr 10, 2009
  2. Junio C HamanoApr 11, 2009
  3. Matthieu MoyApr 12, 2009
  4. Sverre RabbelierApr 12, 2009
  5. Miles BaderApr 13, 2009
  6. Re: git add -p: new "quit" command at the prompt.Nicolas Sebrecht, Apr 12, 2009
  7. Wincent ColaiutaApr 13, 2009
  8. Matthieu MoyApr 14, 2009
  9. Junio C HamanoApr 15, 2009
  10. Jeff KingApr 16, 2009
  11. Jeff KingApr 16, 2009
  12. Jeff KingApr 16, 2009
  13. Matthieu MoyApr 16, 2009
  14. 1/2 git add -p: new "quit" command at the prompt.Matthieu Moy, Apr 16, 2009
  15. 2/2 Update git-add.txt according to the new possibilities of 'git add -p'.Matthieu Moy, Apr 16, 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.