Thread (21 messages) 21 messages, 4 authors, 2025-09-04

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

From: Jean-Noël AVILA <hidden>
Date: 2025-08-21 18:24:17

On Wednesday, 20 August 2025 16:42:46 CEST Lucas Seiki Oshiro wrote:
quoted hunk ↗ jump to hunk
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 [off-list ref]
Mentored-by: Patrick Steinhardt [off-list ref]
Signed-off-by: Lucas Seiki Oshiro <redacted>
---
 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)]



Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help