Re: git bisect bad @
- From
René Scharfe <l.s.r@web.de>
- Date
- Jan 14, 2022, 07:47 UTC
- Message-ID
- <88899d16-5e3e-2bb2-07e9-59f7607c91a8@web.de>
- In-Reply-To
- <925ef53d-c8b2-4ef4-acee-490900e8a3b7@www.fastmail.com>
Am 13.01.22 um 16:16 schrieb Ramkumar Ramachandra:
Show 23 quoted lines
> René Scharfe wrote:
>> The implementation language of git bisect is not immediately relevant
>> here, but that the shell is used to call the user-supplied bisect run
>> script is. If we'd run it directly (without RUN_USING_SHELL) we could
>> distinguish error code 126/127 from execution errors. I assume the
>> option is used to stay compatible with the old shell version of bisect.
>
> Sorry, my misunderstanding. I thought the external command was being
> called from git-bisect.sh. I don't think I understand the purpose of
> RUN_USING_SHELL (it just seems to put an "sh -c" in the beginning):
>
> static const char **prepare_shell_cmd(struct strvec *out, const char **argv)
> {
> ...
> strvec_push(out, "sh");
> strvec_push(out, "-c");
>
> if (!argv[1])
> strvec_push(out, argv[0]);
> else
> strvec_pushf(out, "%s \"$@\"", argv[0]);
> ...
> }Using the shell allows the bisect run command to be any shell command, not just some script. E.g. you could bisect a build failure with just "git bisect run make". Quite useful.
René