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