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
Deveshi Dwivedi <deveshigurgaon@gmail.com>
Date
Apr 5, 2026, 07:02 UTC
Message-ID
<CAG7UgETEGxwXDGoVHT7dPXMDk70FdJd_w+TCPi1LqSvhuqWu4w@mail.gmail.com>
In-Reply-To
<adGfyHbIKixz4dnx@exploit>
Show 26 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.
>
Understood, will use "git reset --hard" here as well.
Show 10 quoted lines
> 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.
Yes, I will update the documentation as well and send a v3 shortly.
Previous: Mirko FainaNext: Deveshi Dwivedi
Message 5 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.