Subject: Re: [PATCH 6/8] t1901: use tr in git repo structure output instead of expected value

From: Lucas Seiki Oshiro <[email-masked]>
Date: Sun, 22 Feb 2026 19:35:19 -0300

>> The test 'keyvalue and nul format', as it description says, test both
>> keyvalue and nul format. These formats are similar, differing only in
>> their field separator (= in the former, LF in the latter) and their
>> record separator (LF in the former, NUL in the latter). This way, both
>> formats can be tested using the same expected output and only replacing
>> the separators in one of the output formats.
> 
> Hm, okay. I have to admit I don't quite understand what we gain here. We
> have to use tr(1) regardless of how we do it, and I cannot see that
> either of these alternatives is clearly superior compared to the other.

I should be clearer about this in my description. Of course, both
approaches work here but this won't output a NUL character if the test
fails, which could be considered as a binary file to diff.

Actually, this is something that Junio saw in a previous patch, and this
was his comment about it [1]:

> * Instead of munging the expected file so that it contains a NUL,
>   and compare the actual output with it, munge the NUL terminated
>   outout to make it text and compare with the expected file in text
>   format. This matters when tests start to fail as test_cmp will
>   show the "diff" output when it fails, and comparing NUL
>   terminated files, which are "binary" in the eyes of the "diff"
>   utility.

But anyway, I'll make it clear in my next version.

Thanks!

[1] [email-masked]