Re: [PATCH v10 2/2] [GSOC] trailer: add new .cmd config option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 17, 2021, 08:11 UTC
- Message-ID
- <xmqqk0p1baad.fsf@gitster.g>
- In-Reply-To
- <CAOLTT8S-CLSk6Obu-8L+QKb9YjBufVTMcTnSrfaUOQmyej59TQ@mail.gmail.com>
ZheNing Hu <adlternative@gmail.com> writes:
> But when I am reproducing your solution, I may be in trouble: > If we let shell-script `exit(1)`, `capture_command()` will output > "running trailer command '%s' failed" which is its origin strategy > in order to catch the user's command error.
Yes, if we were to take that route, the trailer.c code needs to be taught to conditionally not to pass $1, and capture_command() needs to be taught to conditionally be silent on non-zero exit, as it now is a perfectly sane for the program to exit with non-zero status in some cases (like this one).