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

Re: [PATCH] docs: fix git stash grammar

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 27, 2026, 16:53 UTC
Message-ID
<xmqq7bqxkyd5.fsf@gitster.g>
In-Reply-To
<fbe531eb-b742-4cd1-ab6a-2eaaf8d236c5@bluewin.ch>
Quentin Bernet <quentin.bernet@bluewin.ch> 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 ;-)

Previous: Quentin BernetNext: Quentin Bernet
Message 6 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.