git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] docs: fix git stash grammar

From
Ben Knoble <ben.knoble@gmail.com>
Date
Mar 27, 2026, 16:47 UTC
Message-ID
<4B4B5BCF-BC0C-42A1-A6F1-52FF96EF0BFC@gmail.com>
In-Reply-To
<acXIl2cuBv0ifiK6@exploit>
Show 25 quoted lines
> 
> Le 26 mars 2026 à 20:04, Mirko Faina <mroik@delayed.space> a écrit :
> 
> On Thu, Mar 26, 2026 at 12:17:46PM -0400, D. Ben Knoble wrote:
>> 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".
Indeed, thanks. 
Previous: Junio C HamanoNext: Quentin Bernet
Message 11 of 15 in “docs: fix git stash grammar”
  1. docs: fix git stash grammarQuentin Bernet via GitGitGadget, Mar 26, 2026
  2. D. Ben KnobleMar 26, 2026
  3. Mirko FainaMar 27, 2026
  4. Junio C HamanoMar 27, 2026
  5. Quentin BernetMar 27, 2026
  6. Junio C HamanoMar 27, 2026
  7. Quentin BernetMar 27, 2026
  8. Junio C HamanoMar 27, 2026
  9. Quentin BernetMar 27, 2026
  10. Junio C HamanoMar 27, 2026
  11. Ben KnobleMar 27, 2026
  12. Quentin BernetMar 27, 2026
  13. docs: fix "git stash [push]" documentationQuentin Bernet via GitGitGadget, Mar 30, 2026
  14. Junio C HamanoMar 30, 2026
  15. Quentin BernetMar 30, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.