From 3fb3d5289a99611530e1e5402113d682ef69d2cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Polykanine?= Date: Tue, 8 Sep 2026 14:33:41 +0200 Subject: [PATCH] Use LF everywhere, not just in the repository Git stores text as LF whatever the attributes say, so CRLF in the working tree was only ever a conversion layer between the stored form and the one on disk. Nothing here needs it: the repository is C#, YAML, Markdown, JSON and one PowerShell script, and every tool that reads them is content with LF. The only files that genuinely require CRLF are .bat and .cmd, which cmd.exe mis-parses around labels and goto when they are LF-only; there are none, and .gitattributes now carries a rule so that a future one is safe. Two representations meant two chances to be wrong, and both were taken during this project: files written by tooling repeatedly came out with the wrong endings, and a check for the wrong state reported a problem that did not exist. One representation removes the category. The diff is two files. Because the index was already LF, changing eol=crlf to eol=lf alters only what checkout writes, so there is no content change to any source file and no need for a blame-ignore revision. The working tree was converted in place to match what a fresh clone now produces. The explicit eol=lf rather than a bare text=auto is deliberate: text=auto alone gives each platform its native ending, so a Windows clone would get CRLF and fail the end_of_line = lf check that CI gates on, for a reason invisible in the diff. Claude-Session: https://claude.ai/code/session_01TJ8i7jHmkUjVCjVccLp6Hf --- .editorconfig | 2 +- .gitattributes | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.editorconfig b/.editorconfig index 9bc3400..33f944e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,5 @@ [*] -end_of_line = crlf +end_of_line = lf indent_style = space indent_size = 4 insert_final_newline = true diff --git a/.gitattributes b/.gitattributes index f8d3af3..401660d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,13 @@ -# .editorconfig sets end_of_line = crlf, and CI gates on `dotnet format --verify-no-changes`. -# Without this file that check depends on each contributor's core.autocrlf setting, and a -# clone on Linux or with autocrlf=false fails a build for a reason invisible in the diff. -* text=auto eol=crlf +# LF everywhere: in the repository, in the working tree, and on every platform. +# +# Git already stores text as LF whatever this file says, so CRLF in the working tree was only +# ever a conversion layer, and nothing here needs it. `eol=lf` makes the checkout match the +# storage, which means one representation instead of two. +# +# The explicit `eol=lf` rather than a bare `text=auto` is deliberate: `text=auto` alone gives +# each platform its native ending, so a Windows clone would get CRLF and fail the +# `end_of_line = lf` check that CI gates on, for a reason invisible in the diff. +* text=auto eol=lf # Never touched by line-ending normalization. *.png binary @@ -10,5 +16,11 @@ *.nupkg binary *.snupkg binary -# Shell scripts must keep LF or they will not run. +# Shell scripts must keep LF or they will not run. Covered by the rule above, but stated so +# that a future change to it cannot quietly break them. *.sh text eol=lf + +# The genuine exception, for whenever one appears: cmd.exe mis-parses an LF-only batch file +# around labels and goto, so these are the one thing that must stay CRLF. +*.bat text eol=crlf +*.cmd text eol=crlf