public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Lucas Seiki Oshiro <lucasseikioshiro@gmail•com>
To: git@vger•kernel.org
Cc: gitster@pobox•com, jltobler@gmail•com, ps@pks•im,
	Lucas Seiki Oshiro <lucasseikioshiro@gmail•com>
Subject: [PATCH v2 0/3] repo: add -z as an alias for --format=nul to git-repo-structure
Date: Thu,  4 Dec 2025 17:10:09 -0300	[thread overview]
Message-ID: <20251204210843.79411-1-lucasseikioshiro@gmail.com> (raw)
In-Reply-To: <20251130203456.28437-1-lucasseikioshiro@gmail.com>

Hi!

The main objective of this patchset is to add -z to git-repo-structure as
an alias for --format=nul. I'm including two other related patches here:

- a patch removing an extra line in the documentation, which was leaking an + to
  the generated files

- a patch replacing `[--format=...] [-z]` by `[--format=... | -z]` in
  git-repo-info's synopsis

Lucas Seiki Oshiro (3):
  repo: remove blank line from Documentation/git-repo.adoc
  repo: use [--format=... | -z] instead of [-z] in git-repo-info
    synopsis
  repo: add -z as an alias for --format=nul to git-repo-structure

 Documentation/git-repo.adoc | 11 ++++++-----
 builtin/repo.c              |  8 ++++++--
 t/t1901-repo-structure.sh   |  7 +++++++
 3 files changed, 19 insertions(+), 7 deletions(-)

Range-diff against v1:
-:  ---------- > 1:  bfd4ff5db0 repo: remove blank line from Documentation/git-repo.adoc
-:  ---------- > 2:  e5eac8713c repo: use [--format=... | -z] instead of [-z] in git-repo-info synopsis
1:  f051cd41de ! 3:  0ccec7037d repo: add -z as an alias for --format=nul to git-repo-structure
    @@ Documentation/git-repo.adoc
     @@ Documentation/git-repo.adoc: SYNOPSIS
      --------
      [synopsis]
    - git repo info [--format=(keyvalue|nul)] [-z] [--all | <key>...]
    + git repo info [--format=(keyvalue|nul) | -z] [--all | <key>...]
     -git repo structure [--format=(table|keyvalue|nul)]
    -+git repo structure [--format=(table|keyvalue|nul)] [-z]
    ++git repo structure [--format=(table|keyvalue|nul) | -z]
      
      DESCRIPTION
      -----------
    @@ Documentation/git-repo.adoc: supported:
      `-z` is an alias for `--format=nul`.
      
     -`structure [--format=(table|keyvalue|nul)]`::
    -+`structure [--format=(table|keyvalue|nul)] [-z]`::
    ++`structure [--format=(table|keyvalue|nul) | -z]`::
      	Retrieve statistics about the current repository structure. The
      	following kinds of information are reported:
      +
    @@ Documentation/git-repo.adoc: supported:
      	the delimiter between the key and value instead of '='. Unlike the
      	`keyvalue` format, values containing "unusual" characters are never
      	quoted.
    +++
     +`-z` is an alias for `--format=nul`.
      
      INFO KEYS
    @@ builtin/repo.c
     @@
      
      static const char *const repo_usage[] = {
    - 	"git repo info [--format=(keyvalue|nul)] [-z] [--all | <key>...]",
    + 	"git repo info [--format=(keyvalue|nul) | -z] [--all | <key>...]",
     -	"git repo structure [--format=(table|keyvalue|nul)]",
    -+	"git repo structure [--format=(table|keyvalue|nul)] [-z]",
    ++	"git repo structure [--format=(table|keyvalue|nul) | -z]",
      	NULL
      };
      
    @@ t/t1901-repo-structure.sh: test_expect_success 'keyvalue and nul format' '
     +		test_cmp expect_nul out &&
     +		test_line_count = 0 err &&
     +
    -+		# Check -z
    -+		git repo structure --format=nul >out 2>err &&
    ++		# "-z", as a synonym to "--format=nul", participates in the
    ++		# usual "last one wins" rule.
    ++		git repo structure --format=table -z >out 2>err &&
     +
      		test_cmp expect_nul out &&
      		test_line_count = 0 err
-- 
2.50.1 (Apple Git-155)


  parent reply	other threads:[~2025-12-04 21:09 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
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 ` Lucas Seiki Oshiro [this message]
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=20251204210843.79411-1-lucasseikioshiro@gmail.com \
    --to=lucasseikioshiro@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=jltobler@gmail$(echo .)com \
    --cc=ps@pks$(echo .)im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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