git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: js/drop-mingw-test-cmp, was Re: What's cooking in git.git (Dec 2022, #03; Sun, 11)

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 21, 2022, 13:05 UTC
Message-ID
<xmqq7cyksy88.fsf@gitster.g>
In-Reply-To
<c57ecd23-7ca7-2501-983f-6661c7872a01@gmx.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 7 quoted lines
>> IIRC the review comments hinted that MinGW specific test_cmp that
>> equates CRLF and LF are no longer needed,
>
> That does not match my understanding. The MSYS2 tools we use in Git for
> Windows' SDK (and therefore, in the `win` jobs of our CI runs) are outside
> of our control, and have been known to change behavior with regards to
> line endings.
We may have been following two different threads, I suspect?

The behaviour of the platform tools may unexpectedly change without any good reason, and you may not be able to file a bug report when that happens. One way to allow our tests pass in such an environment is to make them sloppy to accomodate the potential variation in their behaviour. That is what the "ignore line ending" comparison gives us.

But it means tests in MinGW environment would not notice if the output _we_ produce from Git has unintentional changes, no? Imagine we break the checkout codepath to write LF working tree files when we should write CRLF, or vice versa. A lenient test_cmp under discussion (whether the one in the current codebase, or the one that the patch wants to update) would not care.

I know we have been operating under such a test environment, but after seeing the exchange between Réne and J6t, I was hoping that we do not have to keep being sloppy. After all, noticing unintended behaviour changes in our code is the whole point of running tests.

Getting rid of the "ignore line ending" comparison would mean that, while we would be able to catch _our_ bugs, we would also notice and have to deal with unintended behaviour changes in MSYS2 tools. But how bad would it be? I doubt that it would be like you update from upstream every other week, and every other such update flips the line endings---that would make you scramble, filing bug reports to MSYS2 and temporarily patching our tests to be sloppier, once every month, that may be a bit too often.

Previous: Johannes SchindelinNext: Johannes Sixt
Message 5 of 11 in “What's cooking in git.git (Dec 2022, #03; Sun, 11)”
  1. Junio C HamanoDec 11, 2022
  2. js/drop-mingw-test-cmp, was Re: What's cooking in git.git (Dec 2022, #03; Sun, 11)Johannes Schindelin, Dec 12, 2022
  3. Junio C HamanoDec 12, 2022
  4. Johannes SchindelinDec 20, 2022
  5. Junio C HamanoDec 21, 2022
  6. Johannes SixtDec 24, 2022
  7. René ScharfeDec 24, 2022
  8. Junio C HamanoDec 25, 2022
  9. Johannes SixtDec 25, 2022
  10. René ScharfeDec 26, 2022
  11. Junio C HamanoDec 27, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.