From: Junio C Hamano <gitster@pobox.com>
To: Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
Cc: git@vger.kernel.org, ps@pks.im, stolee@gmail.com
Subject: Re: [PATCH] backfill: handle unexpected arguments
Date: Fri, 20 Mar 2026 22:03:14 -0700 [thread overview]
Message-ID: <xmqq341tdbal.fsf@gitster.g> (raw)
In-Reply-To: <xmqqtsu9dc9m.fsf@gitster.g> (Junio C. Hamano's message of "Fri, 20 Mar 2026 21:42:13 -0700")
Junio C Hamano <gitster@pobox.com> 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 <r.siddharth.shrimali@gmail.com>
>> ---
>> builtin/backfill.c | 3 +++
>> 1 file changed, 3 insertions(+)
One thing I forgot. You may want to add a test for this.
next prev parent reply other threads:[~2026-03-21 5:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-21 3:16 [PATCH] backfill: handle unexpected arguments Siddharth Shrimali
2026-03-21 4:42 ` Junio C Hamano
2026-03-21 5:03 ` Junio C Hamano [this message]
2026-03-21 17:47 ` [PATCH v2] " Siddharth Shrimali
2026-03-22 1:13 ` Junio C Hamano
2026-03-22 5:32 ` [PATCH v3] " Siddharth Shrimali
2026-03-22 16:38 ` Phillip Wood
2026-03-22 18:06 ` Junio C Hamano
2026-03-22 23:01 ` Derrick Stolee
2026-03-23 1:01 ` Junio C Hamano
2026-03-23 1:42 ` Derrick Stolee
2026-03-23 6:17 ` Siddharth Shrimali
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=xmqq341tdbal.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
--cc=r.siddharth.shrimali@gmail.com \
--cc=stolee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.