On Mon, Feb 13, 2017 at 03:50:43PM -0800, Junio C Hamano wrote:
> Thomas Gummerer <[email protected]> writes:
>
> >> My "-p" suggestion suffers from a similar problem if you treat it as
> >> "you can omit the 'push' if you say "-p", rather than "if -p is the
> >> first option, it is a synonym for 'push -p'".
> >
> > I'm almost convinced of special casing "-p". (Maybe I'm easy to
> > convince as well, because it would be convenient ;) ) However it's a
> > bit weird that now "git stash -p file" would work, but "git stash -m
> > message" wouldn't.
>
> I am not sure why this matters. The original "git stash <msg>" was
> just "Are you being extremely busy and cannot even afford to type
> 'save'? Ok, let me assume you meant that!". Now we are talking
> about picking and choosing hunks carefully going through interactive
> process, I really do not think there is any justification to infer
> 'push' when 'push' was omitted in "git stash push -p" the user wants
> to do.
Maybe it is just me and my muscle memory, but "git stash -p" is quite a
common command for me[1]. And I have typed "git stash -p foo" many times
and been annoyed that it didn't work. I was hoping to end that
annoyance.
I guess I could make an alias and retrain my fingers.
-Peff
[1] I almost never run "reset --hard", preferring instead to stash away
changes just in case I would change my mind later and want them. And
I quite often use "stash -p" because I like to double check what I
am throwing away.
I also use "stash -p" heavily when picking apart changes from the
working tree.