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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <karthik.188@xxxxxxxxx>
> Mentored-by: Patrick Steinhardt <ps@xxxxxx>
> Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@xxxxxxxxx>
> ---
>  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)]








[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux