From: Ben Knoble <ben.knoble@gmail•com>
To: Ruoyu Zhong <zhongruoyu@outlook•com>
Cc: Ruoyu Zhong via GitGitGadget <gitgitgadget@gmail•com>,
git@vger•kernel.org
Subject: Re: [PATCH] bisect: fix handling of `help` and invalid subcommands
Date: Thu, 23 Oct 2025 11:14:05 -0400 [thread overview]
Message-ID: <FA7FE583-1EDB-40D4-A839-3AC78A9666DF@gmail.com> (raw)
In-Reply-To: <DE6BAECC-9A60-490C-AEB4-0958177A1588@outlook.com>
> 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 !
next prev parent reply other threads:[~2025-10-23 15:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-22 8:36 [PATCH] bisect: fix handling of `help` and invalid subcommands Ruoyu Zhong via GitGitGadget
2025-10-22 17:52 ` Ben Knoble
2025-10-22 20:15 ` Ruoyu Zhong
2025-10-23 15:14 ` Ben Knoble [this message]
2025-10-22 18:24 ` Junio C Hamano
2025-10-22 20:20 ` Ruoyu Zhong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=FA7FE583-1EDB-40D4-A839-3AC78A9666DF@gmail.com \
--to=ben.knoble@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitgitgadget@gmail$(echo .)com \
--cc=zhongruoyu@outlook$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox