Re: [PATCH 2/4] rev-list: refactor early option parsing
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 10, 2025, 20:54 UTC
- Message-ID
- <xmqqr03461z7.fsf@gitster.g>
- In-Reply-To
- <20250310192829.661692-3-jltobler@gmail.com>
Justin Tobler <jltobler@gmail.com> writes:
Show 18 quoted lines
> @@ -639,19 +640,15 @@ int cmd_rev_list(int argc,
> if (!strcmp(arg, "--exclude-promisor-objects")) {
> fetch_if_missing = 0;
> revs.exclude_promisor_objects = 1;
> - break;
> - }
> - }
> - for (i = 1; i < argc; i++) {
> - const char *arg = argv[i];
> - if (skip_prefix(arg, "--missing=", &arg)) {
> - if (revs.exclude_promisor_objects)
> - die(_("options '%s' and '%s' cannot be used together"), "--exclude-promisor-objects", "--missing");
> - if (parse_missing_action_value(arg))
> - break;
> + } else if (skip_prefix(arg, "--missing=", &arg)) {
> + parse_missing_action_value(arg);
> }
> }There is a huge NEEDSWORK comment that essentially says that the above two loops that this patch combines into one is fundamentally broken. I suspect that the remaining two patches in this series would punt and not improve them, but offhand I am not sure if this change is making it harder to fix them properly easier or harder.