Re: [GSoC PATCH 1/2] repo: add the flag -z as an alias for --format=nul
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 21, 2025, 21:50 UTC
- Message-ID
- <xmqqect4z6no.fsf@gitster.g>
- In-Reply-To
- <7E449BB1-224F-4B15-BB0B-357E4FB79429@gmail.com>
Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:
Show 10 quoted lines
>>> But I don't have any strong opinion about that. I'm open to suggestions. >> >> Don't ask for suggestions before consulting CodingGuidelines, >> perhaps? > > I think that Patrick was unsure about adding the external parentheses > to make it look like [(--format=(keyvalue|nul) | -z)]. CodingGuideLines > is not explicit about that specific case of having alternate flags > with nested alternate arguments, but I don't see a reason for using > parentheses as it isn't ambiguous...
Parentheses are used for grouping: [(<rev>|<range>)...] (Any number of either <rev> or <range>. Parens are needed to make it clear that "..." pertains to both <rev> and <range>.)
[(-p <parent>)...] (Any number of option -p, each with one <parent> argument.)
If we were saying that these things can occur multiple times, it may benefit from such a grouping by doing
[(--format=(keyvalue|nul) | -z)...]
But the outer () without these extra things, i.e.
[(--format=(keyvalue|nul) | -z)]
does not look like serving any useful purpose at all to me...