git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Keith Smiley <keithbsmiley@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Make stashing nothing exit 1
Date: Sun, 24 Mar 2019 21:42:57 +0900	[thread overview]
Message-ID: <xmqqh8bsphny.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <01020169a7ad6af3-ad50e2d1-19fb-46eb-b397-759f8d579e8b-000000@eu-west-1.amazonses.com> (Keith Smiley's message of "Fri, 22 Mar 2019 23:12:34 +0000")

Keith Smiley <keithbsmiley@gmail.com> writes:

> In the case there are no files to stash, but the user asked to stash, we
> should exit 1 since the stashing failed.
> ---

Sorry, but I fail to see why this is a good change.  Did you have
some script that wanted the exit code from "git stash" to indicate
if it had anything to stash and change the behaviour based on it?

Is it a big enough hassle to figure out if the "stash" command did
something yourself that justifies forcing existing scripts that rely
on "no-op is merely a normal exit" behaviour other people have
written in the past several years?

>  git-stash.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-stash.sh b/git-stash.sh
> index 789ce2f41d4a3..ca362b1a31277 100755
> --- a/git-stash.sh
> +++ b/git-stash.sh
> @@ -318,7 +318,7 @@ push_stash () {
>  	if no_changes "$@"
>  	then
>  		say "$(gettext "No local changes to save")"
> -		exit 0
> +		exit 1
>  	fi
>  
>  	git reflog exists $ref_stash ||
>
> --
> https://github.com/git/git/pull/587

  parent reply	other threads:[~2019-03-24 12:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 23:12 [PATCH] Make stashing nothing exit 1 Keith Smiley
2019-03-23  7:54 ` Ævar Arnfjörð Bjarmason
2019-03-24  3:37   ` Eric Sunshine
2019-03-25 15:29     ` Johannes Schindelin
2020-04-12 13:08   ` Maxim Mazurok
2019-03-24 12:42 ` Junio C Hamano [this message]
2019-05-22 23:57   ` Maksim Odnoletkov
2019-05-23  0:23     ` Ævar Arnfjörð Bjarmason
2019-05-23  6:14     ` Johannes Sixt
2019-05-23  9:49       ` Maksim Odnoletkov

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqh8bsphny.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=keithbsmiley@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).