Re: [PATCH v3 2/2] tests(mingw): avoid very slow `mingw_test_cmp`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 19.11.22 um 00:15 schrieb Junio C Hamano:
> Taylor Blau <me@xxxxxxxxxxxx> writes:
> 
>> One thing that the commit message doesn't allude to (that is covered in
>> the earlier discussion) is why it is important to pass
>> `--ignore-cr-at-eol`. I think that is worth mentioning here.
> 
> Isn't it because Git on the platform is expected to use CRLF in
> certain places, unlike on other platforms where LF is used, but the
> platform port hasn't adjusted tests to match that expectation?  And
> vice versa, where Git is expected to produce LF terminated text
> everywhere but the expected output is not "ported" to force LF
> termination and instead produces CRLF terminated text on platforms
> whose native line ending is CRLF?
> 
> Use of "ignore-cr-at-eol" may allow such tests that are not ported
> correctly to prepare expected output with a "wrong" line ending and
> still pass, and I do think it may be an expedite way to make tests
> appear to pass.

The reason that mingw_test_cmp exists is not that Git isn't ported
correctly, or that tests aren't ported correctly. The reason is that
tests assume Unix LF line endings everywhere, but there are some tools
that are outside our control that randomly -- to the layman's eye --
produce CRLF line endings even when their input has LF style.

For example, when we post-process Git output with `sed`, the result
suddenly has CRLF line endings instead of LF that the input had.

> When Git is expected to produce platform-native line endings,...
There is no such requirement or expectation on Windows. LF style is
acceptable.

-- Hannes




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux