Re: [PATCH 3/4] add: introduce '--resolved' option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 29, 2026, 13:49 UTC
- Message-ID
- <xmqq8q6tc3cy.fsf@gitster.g>
- In-Reply-To
- <xmqqcxw5c3na.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 19 quoted lines
> Michael Montalbo <mmontalbo@gmail.com> writes:
>
>> On Tue, Jul 28, 2026 at 2:58 PM Junio C Hamano <gitster@pobox.com> wrote:
>>>
>>> - if (addremove && take_worktree_changes)
>>> - die(_("options '%s' and '%s' cannot be used together"), "-A", "-u");
>>> + die_for_incompatible_opt3(take_worktree_changes, "-u/--update",
>>> + 0 <= addremove_explicit, "-A/--all",
>>> + add_resolved, "--resolved");
>>>
>>
>> Should this be "0 < addremove_explicit"?
>
> Thanks for noticing. '0 <=' is absolutely bogus.
>
> I wonder if we should simply write 'addremove', as this part of the
> change is about rewriting the open-coded die_for_incompatible_opt2()
> in the original and using die_for_incompatible_opt3() to add a third
> option.Not really. I forgot that addremove is futzed before this part when add_resolved is present, so using addremove would mean both addremove and add_resolved are on, mistakenly complaining about -A that the user never gave us.
So "0 < addremove_explicit" that is.
Show 12 quoted lines
> >>> diff --git a/t/t2207-add-resolved.sh b/t/t2207-add-resolved.sh >>> new file mode 100755 >>> index 0000000000..f88e3f413e >>> --- /dev/null >>> +++ b/t/t2207-add-resolved.sh >> >> Does this new test file need a t/meson.build entry? > > Yeah, it shows that I rarely exercise meson build. > > Thanks.