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

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

From
Mirko Faina <mroik@delayed.space>
Date
Apr 4, 2026, 23:40 UTC
Message-ID
<adGfyHbIKixz4dnx@exploit>
In-Reply-To
<20260404160357.11534-1-deveshigurgaon@gmail.com>
On Sat, Apr 04, 2026 at 04:03:57PM +0000, Deveshi Dwivedi wrote:
Show 22 quoted lines
> +test_expect_success 'assume push when options imply push' '
> +	git reset --hard &&
> +	echo changed >file &&
> +	git add file &&
> +	git stash -m "implied push" file &&
> +	git stash pop &&
> +
> +	git add file &&
> +	git stash --staged file &&
> +	git stash pop &&
> +
> +	git add file &&
> +	git stash --keep-index file &&
> +	git stash pop &&
> +
> +	echo untracked >untracked-file &&
> +	git stash --include-untracked untracked-file &&
> +	test_path_is_missing untracked-file &&
> +	git stash pop &&
> +	rm -f untracked-file
> +'
> +

This leaves 'file' in the staging area. Using "git reset --hard" like you did at the start is probably the easiest way to clean up.

Apart from the testing, since the following is not true anymore...
  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.
...you should probably change the documentation for "git push" as well.
Previous: Deveshi DwivediNext: Deveshi Dwivedi
Message 4 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.