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

From: Junio C Hamano <[email-masked]>
Date: Sun, 30 Nov 2025 18:21:21 -0800

Lucas Seiki Oshiro <[email-masked]> 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]

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