From: Junio C Hamano <gitster@pobox.com>
To: Stephen Oberholtzer <stevie@qrpff.net>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH] bisect run: allow inverting meaning of exit code
Date: Mon, 06 Jan 2020 17:42:58 -0800 [thread overview]
Message-ID: <xmqqpnfw6nz1.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CAD_xR9dGNKdVNzFgFUaZCgJetpW5tXxb8wERovdjbc=1jS-KxA@mail.gmail.com> (Stephen Oberholtzer's message of "Mon, 6 Jan 2020 19:10:00 -0500")
Stephen Oberholtzer <stevie@qrpff.net> writes:
> ... a clean, portable way to create a single case statement that
> handles the final condition.
Hmm, don't we want to say (1) original 0 (success) maps to 1 (2)
original 125 maps to 125 (3) anything below 128 in the original maps
to 0 and (4) everything else is left intact? Perhaps something as
simple like this, taking advantage of the fact that $? won't have
anything other than digits?
... do something ...
status=$?
case $status in
0) status=1 ;;
125) : as-is ;;
? | ?? | 1[01]? | 12[0-7]) status=0;;
*) : as-is ;;
esac
I am still unclear where the need for {SUCCESS_FAIL}_TERM magic
comes from, though.
prev parent reply other threads:[~2020-01-07 1:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-03 4:30 [RFC PATCH] bisect run: allow inverting meaning of exit code Stephen Oberholtzer
2020-01-04 1:22 ` Jonathan Nieder
2020-01-04 5:37 ` Stephen Oberholtzer
2020-01-04 3:27 ` Junio C Hamano
2020-01-04 6:22 ` Stephen Oberholtzer
2020-01-06 1:16 ` Junio C Hamano
2020-01-07 0:10 ` Stephen Oberholtzer
2020-01-07 1:42 ` Junio C Hamano [this message]
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=xmqqpnfw6nz1.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=stevie@qrpff.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