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

Re: [PATCH v3] stash: infer "push" when push-specific options are given

From
Mirko Faina <mroik@delayed.space>
Date
Apr 6, 2026, 18:15 UTC
Message-ID
<adP3JZhS7IHDuUxm@exploit>
In-Reply-To
<20260405110953.3316-1-deveshigurgaon@gmail.com>
On Sun, Apr 05, 2026 at 11:09:53AM +0000, Deveshi Dwivedi wrote:
Show 21 quoted lines
> When "git stash" is run without the "push" subcommand, the command
> tries to assume "push" but rejects any non-option arguments (i.e.,
> pathspecs without "--") to avoid treating a misspelled subcommand
> name as a pathspec.  The only exception is "-p", which sets
> force_assume and allows pathspecs to follow.
> 
> This means "git stash -m foo file" is rejected even though "-m" is
> unambiguously a "push" option, and the user's intent is clear.  The
> same applies to other push-specific options like "--staged",
> "--keep-index", "--include-untracked", and "--pathspec-from-file".
> 
> Expand the set of options that force the "push" assumption to
> include all push-specific options, so that pathspec arguments are
> accepted without requiring "--" or the explicit "push" subcommand
> when the command line already contains a push-only option.
> 
> This was marked as #leftoverbits in [1].
> 
> [1] https://lore.kernel.org/git/xmqqtsu1jipp.fsf@gitster.g/
> 
> Signed-off-by: Deveshi Dwivedi <deveshigurgaon@gmail.com>

Just realized, "--include-untracked" is not specific only to 'push' as 'show' accepts it too as an argument. "--keep-index" as well, but since 'save' is deprecated I don't think anyone would mind and should be fine to leave it as is (though this is my opinion, should wait for others to see what they think).

Previous: Deveshi DwivediNext: Phillip Wood
Message 7 of 17 in “stash: infer "push" when push-specific options are given”
  1. stash: infer "push" when push-specific options are givenDeveshi Dwivedi, Apr 4, 2026
  2. Mirko FainaApr 4, 2026
  3. stash: infer "push" when push-specific options are givenDeveshi Dwivedi, Apr 4, 2026
  4. Mirko FainaApr 4, 2026
  5. Deveshi DwivediApr 5, 2026
  6. stash: infer "push" when push-specific options are givenDeveshi Dwivedi, Apr 5, 2026
  7. Mirko FainaApr 6, 2026
  8. Phillip WoodApr 7, 2026
  9. Deveshi DwivediApr 9, 2026
  10. Mirko FainaApr 9, 2026
  11. Junio C HamanoApr 9, 2026
  12. Junio C HamanoApr 9, 2026
  13. stash: infer "push" when command line starts with an optionDeveshi Dwivedi, Apr 12, 2026
  14. Phillip WoodApr 13, 2026
  15. Junio C HamanoApr 13, 2026
  16. stash: assume "push" when command line starts with an optionDeveshi Dwivedi, Apr 19, 2026
  17. Phillip WoodApr 21, 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.