Re: [PATCH] precompose_utf8: use a flex array for d_name
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 3, 2026, 08:39 UTC
- Message-ID
- <xmqq8q7sjwkl.fsf@gitster.g>
- In-Reply-To
- <20260703050800.GA29216@tb-raspi4>
Torsten Bögershausen <tboegi@web.de> writes:
> Nice, thanks for the patch. One minor nit/question: Do we need a > test_have_prereq PERL in t/t3910 ?
Good question.
Show 11 quoted lines
>> +test_expect_success "status with long non-ASCII filename" ' >> + test_when_finished "rm -rf long-utf8-status" && >> + git init long-utf8-status && >> + ( >> + cd long-utf8-status && >> + test "$(git config --bool core.precomposeunicode)" = true && >> + long_utf8_name=$( >> + perl -e "print q(a) x 249, qq(\342\200\224) x 3, q(.md)" >> + ) && >> + test "$(printf "%s" "$long_utf8_name" | wc -c | tr -d " ")" = 261 && >> + printf "content\n" >"$long_utf8_name" &&
I would say that if we are going to use this construct as-is, then we do need the prereq.
But as far as I can see, this is mostly to create a very long filename, which does not require perl at all, with 9 bytes of binary which could be easily done with printf with the ame backslash notation.
So, if we can fix the test, that would be preferrable.
Thanks.
Show 8 quoted lines
>> + git status --porcelain=v1 >actual >> + ) >> +' >> + >> test_expect_failure 'handle existing decomposed filenames' ' >> echo content >"verbatim.$Adiarnfd" && >> git -c core.precomposeunicode=false add "verbatim.$Adiarnfd" && >>