Subject: Re: [PATCH 05/13] bisect run: keep some of the post-v2.30.0 output

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Mon, 07 Nov 2022 22:40:33 +0100

On Sun, Nov 06 2022, Đoàn Trần Công Danh wrote:

> From: Ævar Arnfjörð Bjarmason <[email-masked]>
>
> Preceding commits fixed output and behavior regressions in
> d1bbbe45df8 (bisect--helper: reimplement `bisect_run` shell function
> in C, 2021-09-13), which did not claim to be changing the output of
> "git bisect run".
>
> But some of the output it emitted was subjectively better, so once
> we've asserted that we're back on v2.29.0 behavior, let's change some
> of it back:
>
> - We now quote the arguments again, but omit the first " " when
>   printing the "running" line.
> - Ditto for other cases where we emitted the argument
> - We say "found first bad commit" again, not just "run success"

So, something you refactored here was that there's now a
do_bisect_run(), and:

> -static int do_bisect_run(const char *command, int argc, const char **argv)
> +static int do_bisect_run(const char *command, int argc UNUSED, const char **argv UNUSED)
>  {
>  	struct child_process cmd = CHILD_PROCESS_INIT;
> -	struct strbuf buf = STRBUF_INIT;
> +	const char *trimed = command;
>  
> -	strbuf_join_argv(&buf, argc, argv, ' ');
> -	printf(_("running %s\n"), buf.buf);
> -	strbuf_release(&buf);
> +	while (*trimed && isspace(*trimed))
> +		trimed++;
> +	printf(_("running %s\n"), trimed);
>  	cmd.use_shell = 1;
>  	strvec_push(&cmd.args, command);
>  	return run_command(&cmd);

Instead of trimming with strbuf_ltrim() we're now using this loop, but
in any case, this has had the effect that you're only fixing one of many
of the output changes. We're still adding this leading whitespace to the
other messages we emit.

As note din the preceding commit you've carried here in 03/13 I didn't
have time to come up with tests for those.