From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Bert Wesarg <bert.wesarg@googlemail.com>,
Jeff King <peff@peff.net>,
Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH] remote: add meaningful exit code on missing/existing
Date: Mon, 26 Oct 2020 11:29:30 -0700 [thread overview]
Message-ID: <xmqqlffset85.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20201026144825.26537-1-avarab@gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Mon, 26 Oct 2020 15:48:25 +0100")
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> Change the exit code for the likes of "git remote add/rename" to exit
> with 2 if the remote in question doesn't exist, and 3 if it
> does. Before we'd just die() and exit with the general 128 exit code.
>
> This changes the output message from e.g.:
>
> fatal: remote origin already exists.
>
> To:
>
> error: remote origin already exists.
>
> Which I believe is a feature, since we generally use "fatal" for the
> generic errors, and "error" for the more specific ones with a custom
> exit code, but this part of the change may break code that already
> relies on stderr parsing (not that we ever supported that...).
Sounds like a worthy goal. One thing that disturbs me somewhat,
which the time will solve without any of our effort, is how the
calling scripts and machinery decides when they can start relying on
the exit codes. A "git remote tell-me-what-you-can-do" command that
may or may not say "exitcode" to its standard output is added?
"test $(git version) -ge 2.30 || old_way"?
The changes to the code all looked quite straight-forward and
the tests look sensible, too.
Thanks.
next prev parent reply other threads:[~2020-10-26 18:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 14:48 [PATCH] remote: add meaningful exit code on missing/existing Ævar Arnfjörð Bjarmason
2020-10-26 14:52 ` Eric Sunshine
2020-10-26 18:29 ` Junio C Hamano [this message]
2020-10-26 19:45 ` Jeff King
2020-10-26 21:00 ` Junio C Hamano
2020-10-27 9:41 ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2020-10-26 19:55 ` [PATCH] " Bert Wesarg
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=xmqqlffset85.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=bert.wesarg@googlemail.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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;
as well as URLs for NNTP newsgroup(s).