Re: [GSoC PATCH v3 1/2] repo: add the flag -z as an alias for --format=nul
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 2, 2025, 16:21 UTC
- Message-ID
- <xmqqms7cltak.fsf@gitster.g>
- In-Reply-To
- <20250901172732.98845-2-lucasseikioshiro@gmail.com>
Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:
Show 26 quoted lines
> Other Git commands that have nul-terminated output (e.g. git-config, > git-status, git-ls-files) have a flag `-z` for using the null character > as the record separator. > > Add the `-z` flag to git-repo-info as an alias for `--format=nul`, > making it consistent with the behavior of the other commands. > > Mentored-by: Karthik Nayak <karthik.188@gmail.com> > Mentored-by: Patrick Steinhardt <ps@pks.im> > Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> > --- > Documentation/git-repo.adoc | 6 ++++-- > builtin/repo.c | 37 +++++++++++++++++++++++++------------ > t/t1900-repo.sh | 12 ++++++++++++ > 3 files changed, 41 insertions(+), 14 deletions(-) > > diff --git a/Documentation/git-repo.adoc b/Documentation/git-repo.adoc > index 2870828d93..6f5ee88215 100644 > --- a/Documentation/git-repo.adoc > +++ b/Documentation/git-repo.adoc > @@ -8,7 +8,7 @@ git-repo - Retrieve information about the repository > SYNOPSIS > -------- > [synopsis] > -git repo info [--format=(keyvalue|nul)] [<key>...] > +git repo info [--format=(keyvalue|nul)] [-z] [<key>...]
This is OK and I do not want you to reroll only to revert this, but FWIW what you had in the previous iteration
git repo info [--format=(keyvalue|nul) | -z] [<key>...]
would also work perfectly well here. It is not like you are forbidding the command line to mention "--format=nul" twice, or "--format=keyvalue --format=nul" to allow the later one to override the former ones.
The updated option parsing looks much nicer. Thanks.