Subject: Re: [PATCH v2 1/2] for-each-repo: optionally keep going on an error

From: Junio C Hamano <[email-masked]>
Date: Mon, 22 Apr 2024 14:39:23 -0700

Jeff King <[email-masked]> writes:

> run_command() may also return the exit code of the program run. So
> imagine a setup like:
>
>   git init
>   git config alias.foo '!exit 123'
>   git config repo.paths "$PWD"
>   git for-each-repo --config=repo.paths foo
>   echo $?
>
> Before the patch we see "123" and after we see "1".

True, or when the process receives a signal, etc.  With this change,
we do lose information.

> I do agree that passing -1 to exit is bad; we maybe should normalize to
> 127 for not found, though I think we could also see -1 for system errors
> like fork() failing.

True, but I think that is a separate issue.

So, let's have a (hopefully final reroll to fix the error code when
stopping at the first error and merge it to 'next'?

Thanks.