git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] bisect: fix handling of `help` and invalid subcommands

From
Ben Knoble <ben.knoble@gmail.com>
Date
Oct 23, 2025, 15:14 UTC
Message-ID
<FA7FE583-1EDB-40D4-A839-3AC78A9666DF@gmail.com>
In-Reply-To
<DE6BAECC-9A60-490C-AEB4-0958177A1588@outlook.com>
Show 34 quoted lines
> Le 22 oct. 2025 à 16:15, Ruoyu Zhong <zhongruoyu@outlook.com> a écrit :
> 
> Hi Ben,
> 
> 
> Thanks for the review!
> 
>> On Oct 23, 2025, at 1:52 AM, Ben Knoble <ben.knoble@gmail.com> wrote:
>> Good catch!
>> FWIW, in this project we describe the buggy behavior in the present tense (« is broken », « Running git bisect shows », etc.)
> 
> Thanks! Will keep this in mind.
> 
>>> diff --git a/builtin/bisect.c b/builtin/bisect.c
>>> index 8b8d870cd1..993caf545d 100644
>>> --- a/builtin/bisect.c
>>> +++ b/builtin/bisect.c
>>> @@ -1453,9 +1453,13 @@ int cmd_bisect(int argc,
>>>     if (!argc)
>>>         usage_msg_opt(_("need a command"), git_bisect_usage, options);
>>> +        if (!strcmp(argv[0], "help"))
>>> +            usage_with_options(git_bisect_usage, options);
>>> +
>> From an extremely quick look at the code, this might be better handled with a new OPT_SUBCOMMAND, though that might mean making the options array statically scoped to this file rather than the function.
> 
> I intended to keep it simple so I did not make it an OPT_SUBCOMMAND at the first
> place. Given that Junio is okay with it, I'm going to keep it as is for now.
> Still happy to turn this into an OPT_SUBCOMMAND if you would like.
> 
>> It would also be nice to update the usage to match the manual while we’re here, which presumably in turn affects the test between command usage and manuals.
> 
> 
> Thanks for pointing that out! Yes, I think so too. Will do in a separate patch,
> if you agree, in order not to digress too much.
Separate is fine, although it might have been nice as part of a series with this one. Since Junio has already marked it to queue, no reason to revisit all the above for this patch. Thanks !
Previous: Ruoyu ZhongNext: Junio C Hamano
Message 4 of 6 in “bisect: fix handling of `help` and invalid subcommands”
  1. bisect: fix handling of `help` and invalid subcommandsRuoyu Zhong via GitGitGadget, Oct 22, 2025
  2. Ben KnobleOct 22, 2025
  3. Ruoyu ZhongOct 22, 2025
  4. Ben KnobleOct 23, 2025
  5. Junio C HamanoOct 22, 2025
  6. Ruoyu ZhongOct 22, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.