Subject: Re: [PATCH] backfill: handle unexpected arguments

From: Junio C Hamano <[email-masked]>
Date: Fri, 20 Mar 2026 22:03:14 -0700

Junio C Hamano <[email-masked]> writes:

> I am not sure if this is a good idea.
>
> When parse_options() finds an unrecognised option, you would get
> usage-with-options help, so without explicitly telling the user
> "Hey, you have an extra argument that I do not expect at the end of
> the command line" and giving only the same usage-with-options help,
> the user would not know why they are seeing the help message, as it
> is totally unclear what mistake they made in their command line.
>
> "git bugreport" is also a command that does not take any positional
> arguments on its command line.  Study how it complains about an
> unwanted argument, and follow its example, perhaps?
>
> Thanks.
>
>> Signed-off-by: Siddharth Shrimali <[email-masked]>
>> ---
>>  builtin/backfill.c | 3 +++
>>  1 file changed, 3 insertions(+)

One thing I forgot.  You may want to add a test for this.