Re: [PATCH v15 07/27] bisect--helper: `bisect_reset` shell function in C
From: Pranit Bauva <hidden>
Date: 2016-11-17 03:56:46
Hey Stephan, On Thu, Nov 17, 2016 at 4:53 AM, Stephan Beyer [off-list ref] wrote:
Hi, On 10/14/2016 04:14 PM, Pranit Bauva wrote:quoted
diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index 4254d61..d84ba86 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c@@ -84,12 +89,47 @@ static int write_terms(const char *bad, const char *good) return (res < 0) ? -1 : 0; } +static int bisect_reset(const char *commit) +{ + struct strbuf branch = STRBUF_INIT; + + if (!commit) { + if (strbuf_read_file(&branch, git_path_bisect_start(), 0) < 1) { + printf("We are not bisecting.\n");I think this string should be marked for translation.
True. Thanks!
quoted
+ return 0; + } + strbuf_rtrim(&branch);[...]quoted
@@ -121,6 +163,10 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) if (argc != 0) die(_("--bisect-clean-state requires no arguments")); return bisect_clean_state(); + case BISECT_RESET: + if (argc > 1) + die(_("--bisect-reset requires either zero or one arguments"));This error message is imho a little unspecific (but this might not be an issue because bisect--helper commands are not really exposed to the user). Maybe "--bisect-reset requires either no argument or a commit."?
That sounds good.
quoted
+ return bisect_reset(argc ? argv[0] : NULL); default: die("BUG: unknown subcommand '%d'", cmdmode); }
Regards, Pranit Bauva