Subject: Re: [GSoC PATCH 1/2] repo: add the flag -z as an alias for --format=nul

From: Jean-Noël AVILA <[email-masked]>
Date: Thu, 21 Aug 2025 20:23:58 +0200

On Wednesday, 20 August 2025 16:42:46 CEST Lucas Seiki Oshiro wrote:
> 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 <[email-masked]>
> Mentored-by: Patrick Steinhardt <[email-masked]>
> Signed-off-by: Lucas Seiki Oshiro <[email-masked]>
> ---
>  Documentation/git-repo.adoc |  6 ++++--
>  builtin/repo.c              | 17 ++++++++++++-----
>  t/t1900-repo.sh             | 12 ++++++++++++
>  3 files changed, 28 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/git-repo.adoc b/Documentation/git-repo.adoc
> index 2870828d93..f2dc71193c 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>...]
> 

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)]