Re: [PATCH 5/6] builtin/repo: add disk size info to keyvalue stucture output
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Dec 12, 2025, 22:36 UTC
- Message-ID
- <e5hsuevw5t37yt3zgp4hhtunusdyeg2lkph52pj4valpmlyrdt@7teicd67atbj>
- In-Reply-To
- <xmqqikeegz8q.fsf@gitster.g>
On 25/12/10 11:58PM, Junio C Hamano wrote:
Show 36 quoted lines
> Justin Tobler <jltobler@gmail.com> writes: > > > -test_expect_success SHA1 'keyvalue and nul format' ' > > +test_expect_success SHA1 'keyvalue format' ' > > test_when_finished "rm -rf repo" && > > git init repo && > > ( > > @@ -106,16 +137,12 @@ test_expect_success SHA1 'keyvalue and nul format' ' > > objects.tags.inflated=132 > > EOF > > > > - git repo structure --format=keyvalue >out 2>err && > > + git repo structure --format=keyvalue >out.raw 2>err && > > > > - test_cmp expect out && > > - test_line_count = 0 err && > > + # Strip object disk usage from output due to platform variance. > > + grep -v "objects\..*\.disk=" out.raw >out && > > > > - # Replace key and value delimiters for nul format. > > - tr "\n=" "\0\n" <expect >expect_nul && > > - git repo structure --format=nul >out 2>err && > > - > > - test_cmp expect_nul out && > > + test_cmp expect out && > > test_line_count = 0 err > > ) > > ' > > This part has both textual and semantic conflicts with Lucas's "-z > is a synonym for --format=nul" topic. I think I resolved it > correctly while improving the "munge expected output into expected > NUL-terminated output" approach to "munge -z output into textual > output and compare with textual expected output". Please sanity > check the result after I push it out, merged at 32f8d84b (Merge > branch 'jt/repo-struct-more-objinfo' into seen, 2025-12-10)
Thanks, this looks correct.
Just FYI, some of the test changes I made here are reverted in the next version since Patrick suggested a better way to test disk usage output. This should allow Lucas's changes to apply a bit more cleanly to this file.
Thanks, -Justin