Re: [PATCH 2/5] cat-file: mention --unordered along with --batch-all-objects
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 8, 2021, 22:04 UTC
- Message-ID
- <xmqqlf33i36a.fsf@gitster.g>
- In-Reply-To
- <YWC7rF4mpU9W6CbI@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> Yes, it would definitely need that extension. But it's also weirder than > that. --textconv is an OPT_CMDMODE(), because it is mutually exclusive > with "-t", etc.
Yeah, in hindsight, we should have made "--textconv" a modifier for "-p", because it is not a true cmdmode. It is much easier to understand if you imagine "--textconv", without a command mode, implies the "-p" mode, but when a command mode like "--batch" is given, that would apply. And it is job of other individual command modes to notice that "--textconv" modifier does not make sense in their context and issue a warning.
Show 5 quoted lines
> The current code uses OPT_CMDMODE() for (1) and (2), and then manually > enforces the exclusion between (1) and (3). But IMHO it is (2) that is > the odd-man out, in that it can be its own mode or a modifier, and it > probably should not be OPT_CMDMODE() (but from the end-user perspective, > that is OK, though it may influence how we document or group things).
I guess we are exactly on the same page (see "'textconv' is a modifier, which implies '-p' command mode unless otherwise specified" above).