Re: [PATCH v15 15/27] bisect--helper: `bisect_next` and `bisect_auto_next` shell function in C
- From
Stephan Beyer <s-beyer@gmx.net>
- Date
- Jan 1, 2017, 16:27 UTC
- Message-ID
- <cdf41dcc-bdc5-a3a7-8d39-8b85e01cda85@gmx.net>
- In-Reply-To
- <CAFZEwPPtF5P5nGp+=btHtwNm1unTJ7qo1khJHCqLvNn1=RYAUQ@mail.gmail.com>
Hi Pranit,
On 12/31/2016 11:43 AM, Pranit Bauva wrote:
Show 15 quoted lines
>>> +
>>> +static int bisect_auto_next(struct bisect_terms *terms, const char *prefix)
>>> +{
>>> + if (!bisect_next_check(terms, NULL))
>>> + return bisect_next(terms, prefix);
>>> +
>>> + return 0;
>>> +}
>>
>> Hmm, the handling of the return values is a little confusing. However,
>> if I understand the sh source correctly, it always returns success, no
>> matter if bisect_next failed or not. I do not know if you had something
>> special in mind here.
>
> Umm. Shell code used to die() and thus exit with an error code.The invoked bisect_next shell code called "exit", right... you had to replace this by passing return values. I get it. Thank you!
Show 13 quoted lines
>>> int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
>>> @@ -643,6 +794,10 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
>>> N_("print out the bisect terms"), BISECT_TERMS),
>>> OPT_CMDMODE(0, "bisect-start", &cmdmode,
>>> N_("start the bisect session"), BISECT_START),
>>> + OPT_CMDMODE(0, "bisect-next", &cmdmode,
>>> + N_("find the next bisection commit"), BISECT_NEXT),
>>> + OPT_CMDMODE(0, "bisect-auto-next", &cmdmode,
>>> + N_("verify the next bisection state then find the next bisection state"), BISECT_AUTO_NEXT),
>>
>> The next bisection *state* is found?
>
> checkout is more appropriate. I don't remember why I used "find"."checkout the next bisection commit" maybe?
Thanks, Stephan