Subject: Re: [PATCH 00/15] tests: don't ignore "git" exit codes

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Fri, 04 Mar 2022 07:57:43 +0100

On Thu, Mar 03 2022, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason <[email-masked]> writes:
>
>> Yes, it returns the correct status code, but that doesn't help with
>> (pseudo)code like:
>>
>> 	if (run_command("foo")) /* exits with e.g. 123 */
>> 		die("oh no, foo failed"); /* exits with 128 */
>>
>> I should have said "code using run-command.c does not do that...",
>> sorry.
>
> Yeah, but even if callers of run_command() can tell "foo"
> segfaulted, I do not think it is sensible to exit as if we
> segfaulted (or, we _could_ actually die by segfaulting ourselves,
> which is worse).

I should have made it clear that I'm thinking about this as a test-only
mode, so hidden behind some GIT_TEST_* variable, i.e. as a means to an
end in getting the test suite to spot the failure in the sub-process.

It's not the only way to do it, but it's the simplest and most reliable
given how our tests are run.