Re: [RFC PATCH] git add -p: new "quit" command at the prompt.
- From
Matthieu Moy <matthieu.moy@imag.fr>
- Date
- Apr 14, 2009, 20:44 UTC
- Message-ID
- <vpqtz4rynhp.fsf@bauges.imag.fr>
- In-Reply-To
- <vpqfxgevy58.fsf@bauges.imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
Show 26 quoted lines
> Junio C Hamano <gitster@pobox.com> writes: > >> 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 ;-).
I think everybody agree that the intention of the patch is good (well, several pro, and no real counter-argument). I'll send an updated version with documentation soon, but I'd appreciate review and comments on the code.
I'm not really happy with the fact that I mainly cut-and-pasted code from the "d" command, but OTOH, that's already how the code is today (huge if/elsif/... with similar elsif blocks for each command).
-- Matthieu