Re: [PATCH v15 07/27] bisect--helper: `bisect_reset` shell function in C
- From
Stephan Beyer <s-beyer@gmx.net>
- Date
- Nov 16, 2016, 23:23 UTC
- Message-ID
- <1190e37e-d54a-7dbf-412d-8dff90ca677a@gmx.net>
- In-Reply-To
- <01020157c38b1aa0-0c1fed14-e058-4621-9958-973113d7e45f-000000@eu-west-1.amazonses.com>
Hi,
On 10/14/2016 04:14 PM, Pranit Bauva wrote:
Show 15 quoted lines
> 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.
> + return 0; > + } > + strbuf_rtrim(&branch);
[...]
Show 7 quoted lines
> @@ -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."?
> + return bisect_reset(argc ? argv[0] : NULL);
> default:
> die("BUG: unknown subcommand '%d'", cmdmode);
> }~Stephan