Re: [PATCH v3] backfill: handle unexpected arguments
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Mar 23, 2026, 01:42 UTC
- Message-ID
- <6460601f-ff72-4683-abd1-2ae4c8352a27@gmail.com>
- In-Reply-To
- <xmqqa4vz7400.fsf@gitster.g>
On 3/22/26 9:01 PM, Junio C Hamano wrote:
Show 19 quoted lines
> Derrick Stolee <stolee@gmail.com> writes:
>
>>> + if (argc) {
>>> + error(_("unknown argument '%s'"), argv[0]);
>>> + usage(builtin_backfill_usage[0]);
>>> + }
>>
>> Before we get too far into this: How does this interact with
>> the ongoing change to introduce revision arguments to 'git
>> backfill' [1]?
>
> Ahh, that one completely slipped my mind.
>
> Thanks for a doze of sanity. This patch becomes completely
> irrelevant if we are taking command line arguments.
>
> It will become the responsibility of the other topic to detect and
> complain about excess command line parameters (unless the feature it
> adds absorbs all of them, which may be the case).At the end of my series, the error output for an unknown argument now looks like this:
fatal: ambiguous argument 'unexpected-arg': unknown revision or path not in the working tree.
I'm not sure it's worth updating this, but I can incorporate a test that shows that this is handled.
Thanks, -Stolee