git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] repo: add -z as an alias for --format=nul to git-repo-structure

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 1, 2025, 02:21 UTC
Message-ID
<xmqqms43aqn2.fsf@gitster.g>
In-Reply-To
<20251130203456.28437-1-lucasseikioshiro@gmail.com>
Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:
> -git repo structure [--format=(table|keyvalue|nul)]
> +git repo structure [--format=(table|keyvalue|nul)] [-z]
It's a minor thing but I wonder if this should be more like
    git repo structure [--format=(table|keyvalue|nul) | -z]
Show 13 quoted lines
> diff --git a/t/t1901-repo-structure.sh b/t/t1901-repo-structure.sh
> index 36a71a144e..5a50acf345 100755
> --- a/t/t1901-repo-structure.sh
> +++ b/t/t1901-repo-structure.sh
> @@ -101,6 +101,12 @@ test_expect_success 'keyvalue and nul format' '
>  		tr "\n=" "\0\n" <expect >expect_nul &&
>  		git repo structure --format=nul >out 2>err &&
>  
> +		test_cmp expect_nul out &&
> +		test_line_count = 0 err &&
> +
> +		# Check -z
> +		git repo structure --format=nul >out 2>err &&

Didn't you want to check "-z", not "--format=nul"? In addition, perhaps test

	# "-z", as a synonym to "--format=nul", participates in the
	# usual "last one wins" rule.
	git repo structure --format=table -z >out 2>err &&

as well, or is it too obvious (by knowing how parse-options API is used) that it is pointless to test?

>  		test_cmp expect_nul out &&
>  		test_line_count = 0 err
>  	)
Previous: Lucas Seiki OshiroNext: Patrick Steinhardt
Message 2 of 15 in “repo: add -z as an alias for --format=nul to git-repo-structure”
  1. repo: add -z as an alias for --format=nul to git-repo-structureLucas Seiki Oshiro, Nov 30, 2025
  2. Junio C HamanoDec 1, 2025
  3. Patrick SteinhardtDec 1, 2025
  4. Lucas Seiki OshiroDec 1, 2025
  5. Junio C HamanoDec 2, 2025
  6. Lucas Seiki OshiroDec 2, 2025
  7. Justin ToblerDec 1, 2025
  8. Lucas Seiki OshiroDec 2, 2025
  9. 0/3 repo: add -z as an alias for --format=nul to git-repo-structureLucas Seiki Oshiro, Dec 4, 2025
  10. 1/3 repo: remove blank line from Documentation/git-repo.adocLucas Seiki Oshiro, Dec 4, 2025
  11. 2/3 repo: use [--format=... | -z] instead of [-z] in git-repo-info synopsisLucas Seiki Oshiro, Dec 4, 2025
  12. 3/3 repo: add -z as an alias for --format=nul to git-repo-structureLucas Seiki Oshiro, Dec 4, 2025
  13. Junio C HamanoDec 11, 2025
  14. Lucas Seiki OshiroDec 18, 2025
  15. Patrick SteinhardtDec 5, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.