Re: [PATCH] add-interactive: shortcut to add hunk and quit
- From
Michael J Gruber <git@drmicha.warpmail.net>
- Date
- May 18, 2011, 09:26 UTC
- Message-ID
- <4DD390AF.9020705@drmicha.warpmail.net>
- In-Reply-To
- <20110518064515.GA29612@sigill.intra.peff.net>
Jeff King venit, vidit, dixit 18.05.2011 08:45:
Show 30 quoted lines
> On Tue, May 17, 2011 at 11:40:03PM -0700, Pete Harlan wrote: > >> On 05/17/2011 12:12 AM, Hermann Gausterer wrote: >>> this combines the two "add -i" commands "y"+"q" to one. >> >> ... >> >>> y - stage this hunk >>> n - do not stage this hunk >>> q - quit; do not stage this hunk nor any of the remaining ones >>> + Q - stage this hunk but none of the remaining ones >>> a - stage this hunk and all later hunks in the file >>> d - do not stage this hunk nor any of the later hunks in the file >>> g - select a hunk to go to >> >> If "q" means "quit", I would expect "Q" to mean something like "quit >> immediately" (perhaps even undoing earlier adds), not "do something >> that 'q' wouldn't do, and then quit". > > I agree. There was some discussion in another thread recently of the > atomicity of git-add (right now it applies the changes to each file > after all of its hunks are done). I would expect "q" to be "quit and > apply what I told you so far" and "Q" to be "quit and do not apply > anything". > >> Perhaps "o" (for "stage exactly [o]ne commit"), or "t" for "stage >> [t]his commit" would be reasonable alternatives? > > We could also allow multiple commands at once, like "yq" (even in > single-key mode, this would do the same thing).
So instead of having to
press y press q
I can now
hold SHIFT press q
Seeing the gain in that fails me completely. Also, why doesn't "yd" deserve a shortcut? I would expect that to be used more often, as in: "Yes, that was the hunk I wanted to add from this file, but what other files have changes"?
Michael