Re: [PATCH v17 0/7] git bisect: convert from shell to C
- From
Ramsay Jones <ramsay@ramsayjones.plus.com>
- Date
- Jan 3, 2019, 01:19 UTC
- Message-ID
- <d64492dc-4643-823b-c804-3c152c4d9090@ramsayjones.plus.com>
- In-Reply-To
- <pull.101.v17.git.gitgitgadget@gmail.com>
On 02/01/2019 15:38, Tanushree Tumane via GitGitGadget wrote: [snip]
> base-commit: 7f4e64169352e03476b0ea64e7e2973669e491a2 > Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-101%2Ftanushree27%2Fgit-bisect_part2_fixup-v17 > Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-101/tanushree27/git-bisect_part2_fixup-v17 > Pull-Request: https://github.com/gitgitgadget/git/pull/101
I didn't look at the patches, only the range-diff below, and the only thing I noticed was ...
Show 40 quoted lines
>
> Range-diff vs v16:
>
> 1: f1e89ba517 ! 1: 338ebdc97a bisect--helper: `bisect_reset` shell function in C
> @@ -16,8 +16,9 @@
>
> Mentored-by: Lars Schneider <larsxschneider@gmail.com>
> Mentored-by: Christian Couder <chriscool@tuxfamily.org>
> + Mentored by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
> - Signed-off-by: Junio C Hamano <gitster@pobox.com>
> + Signed-off-by: Tanushree Tumane <tanushreetumane@gmail.com>
>
> diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
> --- a/builtin/bisect--helper.c
> @@ -53,8 +54,10 @@
> + struct strbuf branch = STRBUF_INIT;
> +
> + if (!commit) {
> -+ if (strbuf_read_file(&branch, git_path_bisect_start(), 0) < 1)
> -+ return !printf(_("We are not bisecting.\n"));
> ++ if (strbuf_read_file(&branch, git_path_bisect_start(), 0) < 1) {
> ++ printf(_("We are not bisecting.\n"));
> ++ return 0;
> ++ }
> + strbuf_rtrim(&branch);
> + } else {
> + struct object_id oid;
> @@ -69,11 +72,11 @@
> +
> + argv_array_pushl(&argv, "checkout", branch.buf, "--", NULL);
> + if (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {
> -+ error(_("Could not check out original HEAD '%s'. Try "
> -+ "'git bisect reset <commit>'."), branch.buf);
> + strbuf_release(&branch);
> + argv_array_clear(&argv);
> -+ return -1;
> ++ return error(_("could not check out original"
> ++ " HEAD '%s'. Try 'git bisect"
> ++ "reset <commit>'."), branch.buf);... this 'branch.buf' will refer to the empty 'slopbuf', since the call to 'strbuf_release(&branch)' now precedes this call to error().
ATB, Ramsay Jones