From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>,
git@vger.kernel.org, jltobler@gmail.com
Subject: Re: [PATCH] repo: add -z as an alias for --format=nul to git-repo-structure
Date: Mon, 01 Dec 2025 19:45:07 -0800 [thread overview]
Message-ID: <xmqqsedt8s3g.fsf@gitster.g> (raw)
In-Reply-To: <aS1Rvy9J2KjWrQb4@pks.im> (Patrick Steinhardt's message of "Mon, 1 Dec 2025 09:28:47 +0100")
Patrick Steinhardt <ps@pks.im> writes:
> I think this ultimately stems from [2], where you argue that it _is_
> possible to say `git repo info --format=table -z`, and the last option
> wins. It's the same for `git repo structure`, so I'd argue we should be
> consistent.
I do not think so; [2] was about the explicit "--format=nul and -z
are incompatible" code. Even without this '-z" thing, if you have
[--opt=(a|b|c)]
I _think_ our intention is to allow "git cmd --opt=a --opt=b" from
the user and let the last one win. If you add "-z",
[--format=(table|keyvalue|nul)] [-z]
[--format=(table|keyvalue|nul) | -z]
I think both would mean the same thing; I just was wonering if
grouping them together in one bracket makes it more obvious that
these are all options to control the output format.
There was also an inquiry about writing it like
[(--format=(table|keyvalue|nul) | -z)]
or even
[(--format=(table|keyvalue|nul) | -z)...]
as these can be repeated and let the last-one-wins rule decide the
final outcome, but we do not do that. I thought the final comment
on this was in
https://lore.kernel.org/git/6186055.lOV4Wx5bFT@cayenne/
where the message said
In fact the correct formatting is:
[--format=(keyvalue|nul) | -z] [<key>...]
As stated in "CodingGuidelines:
Use spacing around "|" token(s), but not immediately after opening or
before closing a [] or () pair:
Do: [-q | --quiet]
Don't: [-q|--quiet]
Don't use spacing around "|" tokens when they're used to separate the
alternate arguments of an option:
Do: --track[=(direct|inherit)]
Don't: --track[=(direct | inherit)]
and that was where the thread ended, I think.
> [1]: <20250820144247.79197-1-lucasseikioshiro@gmail.com>
> [2]: <xmqqcy8frqn2.fsf@gitster.g>
next prev parent reply other threads:[~2025-12-02 3:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-30 19:59 [PATCH] repo: add -z as an alias for --format=nul to git-repo-structure Lucas Seiki Oshiro
2025-12-01 2:21 ` Junio C Hamano
2025-12-01 8:28 ` Patrick Steinhardt
2025-12-01 14:34 ` Lucas Seiki Oshiro
2025-12-02 3:45 ` Junio C Hamano [this message]
2025-12-02 22:05 ` Lucas Seiki Oshiro
2025-12-01 15:11 ` Justin Tobler
2025-12-02 0:29 ` Lucas Seiki Oshiro
2025-12-04 20:10 ` [PATCH v2 0/3] " Lucas Seiki Oshiro
2025-12-04 20:10 ` [PATCH v2 1/3] repo: remove blank line from Documentation/git-repo.adoc Lucas Seiki Oshiro
2025-12-04 20:10 ` [PATCH v2 2/3] repo: use [--format=... | -z] instead of [-z] in git-repo-info synopsis Lucas Seiki Oshiro
2025-12-04 20:10 ` [PATCH v2 3/3] repo: add -z as an alias for --format=nul to git-repo-structure Lucas Seiki Oshiro
2025-12-11 5:23 ` Junio C Hamano
2025-12-18 23:02 ` Lucas Seiki Oshiro
2025-12-05 11:09 ` [PATCH v2 0/3] " Patrick Steinhardt
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=xmqqsedt8s3g.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jltobler@gmail.com \
--cc=lucasseikioshiro@gmail.com \
--cc=ps@pks.im \
/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;
as well as URLs for NNTP newsgroup(s).