Re: [PATCH] tests: replace mingw_test_cmp with a helper in C
- From
René Scharfe <l.s.r@web.de>
- Date
- Sep 8, 2022, 08:59 UTC
- Message-ID
- <2d839209-21e2-b05c-125b-57a9c1dad1ea@web.de>
- In-Reply-To
- <xmqq7d2fywvr.fsf@gitster.g>
Am 07.09.22 um 18:25 schrieb Junio C Hamano:
Show 15 quoted lines
> René Scharfe <l.s.r@web.de> writes: > >>>> But otherwise the idea is sound. We compare them line by line, >>>> using strbuf_getline() to ignore differences in CRLF and LF that >>>> originates at 4d715ac0 (Windows: a test_cmp that is agnostic to >>>> random LF <> CRLF conversions, 2013-10-26). Only when we find the >>>> input different, we use "git diff --no-index" to make the difference >>>> (and unfortunately more, as it does not ignore CRLF <> LF >>>> differences) visible. >> >> Why not use "git diff --no-index --ignore-cr-at-eol"? Do you even need >> to wrap it? > > Hmph. That surely sounds sensible if it works, and I offhand do not > see why it shouldn't work.
Using git diff in test_cmp and using test_cmp to check if git diff works would become a cyclical dependency. Only doing that on one platform limits the potential blind spot to platform-specific bugs, though. Enough to go wrapper-less? Not sure.
René