Re: [RFC PATCH] bisect run: allow inverting meaning of exit code
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 7, 2020, 01:42 UTC
- Message-ID
- <xmqqpnfw6nz1.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <CAD_xR9dGNKdVNzFgFUaZCgJetpW5tXxb8wERovdjbc=1jS-KxA@mail.gmail.com>
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 ;;
esacI am still unclear where the need for {SUCCESS_FAIL}_TERM magic comes from, though.