Subject: Re: [PATCH] docs: fix git stash grammar

From: Quentin Bernet <[email-masked]>
Date: Fri, 27 Mar 2026 17:58:19 +0100

Just so we're clear: my previous grammar did allow "git stash path1 
path2" (no "push", no "--"), which is not allowed
Do you still think it is good enough ?

"the command line description needs to mention that." that is already 
the case, no ?

On 3/27/26 17:53, Junio C Hamano wrote:
> Quentin Bernet <[email-masked]> writes:
>
>> My previous, simpler, grammar included "git stash <pathspec>" even
>> though it is not valid.
> "git stash -- path1 path2 ..." is valid and is taken as elliding the
> subcommand name 'push'.  So I think your previous one is good enough
> but the command line description needs to mention that.  Double dash
> is used to signal the start of pathspec when ambiguous, and it is a
> good example to highlight when it is useful.  Without disambiguating
> "--", "path1" might be misspelt subcommand name but we cannot tell
> which one.  You may even have a file whose name is "pop", and "git
> stash -- pop" would be a way to save away the changes to the file
> without having to say "push" explicitly ;-)
>