From: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> 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" Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@xxxxxxxxx> --- builtin/bisect--helper.c | 12 ++++++------ t/t6030-bisect-porcelain.sh | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index 7416283d07..f16b9df8fd 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c @@ -1141,14 +1141,14 @@ static int get_first_good(const char *refname UNUSED, return 1; } -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); @@ -1266,7 +1266,7 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc) puts(_("bisect run success")); res = BISECT_OK; } else if (res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND) { - puts(_("bisect run success")); + puts(_("bisect found first bad commit")); res = BISECT_OK; } else if (res) { error(_("bisect run failed: 'bisect-state" diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh index 914ea564b9..9e14e1e836 100755 --- a/t/t6030-bisect-porcelain.sh +++ b/t/t6030-bisect-porcelain.sh @@ -288,9 +288,9 @@ test_bisect_run_args () { test_expect_success 'git bisect run: args, stdout and stderr with no arguments' ' test_bisect_run_args <<-\EOF_ARGS 6<<-EOF_OUT 7<<-\EOF_ERR EOF_ARGS - running ./run.sh + running '\''./run.sh'\'' $HASH4 is the first bad commit - bisect run success + bisect found first bad commit EOF_OUT EOF_ERR ' @@ -299,9 +299,9 @@ test_expect_success 'git bisect run: args, stdout and stderr: "--" argument' ' test_bisect_run_args -- <<-\EOF_ARGS 6<<-EOF_OUT 7<<-\EOF_ERR <--> EOF_ARGS - running ./run.sh -- + running '\''./run.sh'\'' '\''--'\'' $HASH4 is the first bad commit - bisect run success + bisect found first bad commit EOF_OUT EOF_ERR ' @@ -313,9 +313,9 @@ test_expect_success 'git bisect run: args, stdout and stderr: "--log foo --no-lo <--no-log> <bar> EOF_ARGS - running ./run.sh --log foo --no-log bar + running '\''./run.sh'\'' '\''--log'\'' '\''foo'\'' '\''--no-log'\'' '\''bar'\'' $HASH4 is the first bad commit - bisect run success + bisect found first bad commit EOF_OUT EOF_ERR ' @@ -324,9 +324,9 @@ test_expect_success 'git bisect run: args, stdout and stderr: "--bisect-start" a test_bisect_run_args --bisect-start <<-\EOF_ARGS 6<<-EOF_OUT 7<<-\EOF_ERR <--bisect-start> EOF_ARGS - running ./run.sh --bisect-start + running '\''./run.sh'\'' '\''--bisect-start'\'' $HASH4 is the first bad commit - bisect run success + bisect found first bad commit EOF_OUT EOF_ERR ' -- 2.38.1.157.gedabe22e0a