From: Junio C Hamano <gitster@pobox.com>
To: Michael Montalbo <mmontalbo@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 3/4] add: introduce '--resolved' option
Date: Sat, 01 Aug 2026 19:23:02 -0700 [thread overview]
Message-ID: <xmqq4ihd5khl.fsf@gitster.g> (raw)
In-Reply-To: <xmqq8q6tc3cy.fsf@gitster.g> (Junio C. Hamano's message of "Wed, 29 Jul 2026 06:49:49 -0700")
Junio C Hamano <gitster@pobox.com> writes:
>> 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.
Well, this episode illustrates that the option parsing in "git add"
is unnecessarily confusing, and I think the reason is because it
conflates the presence of each command line option and the behaviour
the program wants to exhibit into the same variable. addremove for
example is about "removals are also recorded in the index", and that
becomes effective primarily when "-A" option is given, but "-A" is
not the only thing to turn it on.
Perhaps revamping the way the options are parsed so that the
incompatible options are noticed upfront, and then deciding the
behaviour based on the primary operating mode that was parsed by the
ooption parser in a separate step might make things less confusing?
next prev parent reply other threads:[~2026-08-02 2:23 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 21:52 [PATCH 0/4] git add --resolved Junio C Hamano
2026-07-28 21:52 ` [PATCH 1/4] merge-ll: consolidate conflict marker scanning logic Junio C Hamano
2026-07-28 21:52 ` [PATCH 2/4] read-cache: add remove_file_from_index_with_flags() Junio C Hamano
2026-07-28 21:52 ` [PATCH 3/4] add: introduce '--resolved' option Junio C Hamano
2026-07-29 3:28 ` Michael Montalbo
2026-07-29 13:43 ` Junio C Hamano
2026-07-29 13:49 ` Junio C Hamano
2026-08-02 2:23 ` Junio C Hamano [this message]
2026-07-29 15:01 ` Junio C Hamano
2026-08-02 0:49 ` Michael Montalbo
2026-07-28 21:52 ` [PATCH 4/4] read-cache: reindent Junio C Hamano
2026-07-29 17:25 ` [PATCH v2 0/4] git add --resolved Junio C Hamano
2026-07-29 17:25 ` [PATCH v2 1/4] read-cache: reindent Junio C Hamano
2026-07-29 17:25 ` [PATCH v2 2/4] merge-ll: consolidate conflict marker scanning logic Junio C Hamano
2026-07-29 17:25 ` [PATCH v2 3/4] read-cache: add remove_file_from_index_with_flags() Junio C Hamano
2026-07-29 17:25 ` [PATCH v2 4/4] add: introduce '--resolved' option Junio C Hamano
2026-07-29 22:19 ` Junio C Hamano
2026-07-29 23:41 ` [PATCH v2 0/4] git add --resolved Michael Montalbo
2026-07-30 8:41 ` Junio C Hamano
2026-08-02 0:22 ` Michael Montalbo
2026-07-31 12:56 ` [PATCH v3 " Junio C Hamano
2026-07-31 12:56 ` [PATCH v3 1/4] read-cache: reindent Junio C Hamano
2026-07-31 12:56 ` [PATCH v3 2/4] merge-ll: consolidate conflict marker scanning logic Junio C Hamano
2026-07-31 12:56 ` [PATCH v3 3/4] read-cache: add remove_file_from_index_with_flags() Junio C Hamano
2026-07-31 12:56 ` [PATCH v3 4/4] add: introduce '--resolved' option Junio C Hamano
2026-08-01 14:14 ` [PATCH v3 0/4] git add --resolved Jeff King
2026-08-01 17:58 ` Junio C Hamano
2026-08-01 21:45 ` Junio C Hamano
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=xmqq4ihd5khl.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mmontalbo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox