Git development
 help / color / mirror / Atom feed
From: Mirko Faina <mroik@delayed.space>
To: Deveshi Dwivedi <deveshigurgaon@gmail.com>
Cc: git@vger.kernel.org, ben.knoble@gmail.com,
	quentin.bernet@bluewin.ch,  gitster@pobox.com,
	Mirko Faina <mroik@delayed.space>
Subject: Re: [PATCH v2] stash: infer "push" when push-specific options are given
Date: Sun, 5 Apr 2026 01:40:57 +0200	[thread overview]
Message-ID: <adGfyHbIKixz4dnx@exploit> (raw)
In-Reply-To: <20260404160357.11534-1-deveshigurgaon@gmail.com>

On Sat, Apr 04, 2026 at 04:03:57PM +0000, Deveshi Dwivedi wrote:
> +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.

  reply	other threads:[~2026-04-04 23:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-04 14:36 [PATCH] stash: infer "push" when push-specific options are given Deveshi Dwivedi
2026-04-04 15:19 ` Mirko Faina
2026-04-04 16:03 ` [PATCH v2] " Deveshi Dwivedi
2026-04-04 23:40   ` Mirko Faina [this message]
2026-04-05  7:02     ` Deveshi Dwivedi
2026-04-05 11:09 ` [PATCH v3] " Deveshi Dwivedi
2026-04-06 18:15   ` Mirko Faina
2026-04-07  9:36     ` Phillip Wood
2026-04-09 19:22       ` Deveshi Dwivedi
2026-04-09 19:37         ` Mirko Faina
2026-04-09 20:31       ` Junio C Hamano
2026-04-09 20:22   ` Junio C Hamano
2026-04-12 19:52 ` [PATCH v4] stash: infer "push" when command line starts with an option Deveshi Dwivedi
2026-04-13  9:08   ` Phillip Wood
2026-04-13 15:09   ` Junio C Hamano
2026-04-19 16:54 ` [PATCH v5] stash: assume " Deveshi Dwivedi
2026-04-21 15:28   ` Phillip Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=adGfyHbIKixz4dnx@exploit \
    --to=mroik@delayed.space \
    --cc=ben.knoble@gmail.com \
    --cc=deveshigurgaon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=quentin.bernet@bluewin.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox