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.