Re: [PATCH 2/3] t: add "test-tool genbytes" to avoid slow tr(1) on macOS
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Nov 9, 2026, 09:33 UTC
- Message-ID
- <ddea802a-d4f4-4de9-9108-e68201841bc4@kdbg.org>
- In-Reply-To
- <c8688e1a-17b6-4d0b-ba9a-fc1e0fa8938b@kdbg.org>
Am 08.11.26 um 17:34 schrieb Johannes Sixt:
Show 11 quoted lines
> Am 08.11.26 um 13:24 schrieb Kristofer Karlsson:
>> - test-tool genzeros 2147483649 | tr "\000" "1" >expect &&
>> + printf 000000000%02147483640d 0 >expect &&
>>
>> I tried this out and it works on Linux but fails on macOS[1]. What
>> happens is that printf only outputs the nine literal zeros
>> ("000000000") there, and silently ignores the very large padding.
>
> Fair enough.
>
>> [1] https://github.com/gitgitgadget/git/actions/runs/42475956442/job/128717309586Well, this patch passed for me[2], but I have no idea whether the particular tests were skipped due to the EXPENSIVE prerequisite or not.
[2] https://github.com/j6t/git/actions/runs/42583623620/job/129048078411
diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh index 01b97c8888..5dedb9054e 100755 --- a/t/t4205-log-pretty-formats.sh +++ b/t/t4205-log-pretty-formats.sh @@ -1182,7 +1182,8 @@ unfold () { ' test_expect_success EXPENSIVE,SIZE_T_IS_64BIT 'set up huge commit' ' - test-tool genzeros 2147483649 | tr "\000" "1" >expect && + # 3 * 715827883 == 2147483649 + printf %0715827883d 0 0 0 >expect && huge_commit=$(git commit-tree -F expect HEAD^{tree}) '