Re: [PATCH] docs: fix git stash grammar
- From
Mirko Faina <mroik@delayed.space>
- Date
- Mar 27, 2026, 00:04 UTC
- Message-ID
- <acXIl2cuBv0ifiK6@exploit>
- In-Reply-To
- <CALnO6CD-5NBUoooMD+pQAxeyXCjkZ3Za6LJrLrJN57Nrz03xBw@mail.gmail.com>
On Thu, Mar 26, 2026 at 12:17:46PM -0400, D. Ben Knoble wrote:
Show 11 quoted lines
> Now, _is_ the grammar bracketed wrong? "git help stash" says > > For quickly making a snapshot, you can omit "push". In this mode, > non-option arguments are not allowed to prevent a misspelled > subcommand from making an unwanted stash entry. The two exceptions > to this are stash -p which acts as alias for stash push -p and > pathspec elements, which are allowed after a double hyphen -- for > disambiguation. > > So _if_ you want to provide options (other than "-p"), the "push" is > required. I think the existing brackets indicate that.
When it says "In this mode, non-option arguments are not allowed" wouldn't -m be allowed as it is an option and not a non-option? In fact if we do try to run "git stash -m something" it does correctly stash while if we do something like "git stash pathspec" it does give back "fatal: subcommand wasn't specified; 'push' can't be assumed due to unexpected token 'pathspec'".
If that is the case then there is an issue with the way the usage tooltip shows the optionality of "push".