chore: normalize line endings to LF#1314
Merged
Merged
Conversation
Rewrite `.gitattributes` to `* text=auto eol=lf` so every text file is stored as LF in the repo and checked out as LF on every platform. Windows-only scripts (`.bat`, `.cmd`, `.ps1`) are excepted — those file types genuinely require CRLF for the Windows shell to execute them. Run `git add --renormalize .` to apply the new rule to the existing tree. The prior `.gitattributes` contained `text eol=crlf` — a one-line attribute entry with no pattern, so the `text` attribute applied to a file literally named `text` (which does not exist) and was a no-op. CRLF line endings across the repo were a historical accident from Windows/Eclipse editors rather than an enforced policy. `text=auto` lets Git autodetect binary content (via null-byte scanning) and leave it alone; verified with a whitespace-ignored diff that shows only `.gitattributes` as a content change — the remaining 2204-file diff is EOL-only. Windows developers may need `git config core.autocrlf false` locally if they relied on the old behaviour, or rebase any open branches onto this commit rather than merging. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 17, 2026
rubenporras
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Normalize all text files in the repo to LF line endings, stored as LF in the repo and checked out as LF on every platform. Fixes a long-standing historical accident.
What changes
.gitattributesrewritten from the brokentext eol=crlf(one line, no pattern — applied to a file literally namedtextthat does not exist, so it was a no-op) to:git add --renormalize .run on top to apply the new rule to the existing tree..bat,.cmd,.ps1) stay CRLF since the Windows shell genuinely requires it. The repo has none today, but the exception is future-proofing.text=autolets Git autodetect binary files via null-byte scanning; binaries (.gif,.png,.jar, etc.) are untouched. Verified: a whitespace-ignored diff of the commit shows only.gitattributesas a content change — the rest is pure EOL churn.Why now
Current CRLF endings are a historical accident from Windows/Eclipse editors, not an enforced policy (the prior
.gitattributeswas effectively a no-op). LF is the standard in modern cross-platform tooling. Keeping CRLF introduces^Mnoise in diffs, confuses POSIX tools (grep,sed,patch), and makes stray LF-only additions from Unix editors trivially corrupt the convention — which is how we ended up here.How collaborators handle open branches
When this merges, branches cut from pre-normalization master will look like they changed every line of every text file. Don't panic — rebase, don't merge, and let
merge.renormalizedo the heavy lifting.For branch authors (the common path)
Why
merge.renormalize=true: tells Git to run text files through the current.gitattributesfilter during 3-way merge. Without it, rebase thinks every file changed 100% of its lines (CRLF vs LF) and yells about phantom conflicts. With it, Git reconciles normalization and only flags real content conflicts.Why rebase not merge: merging this commit into a CRLF branch creates a giant merge commit with ~946k lines of churn on both sides. Rebase walks your real commits onto the normalized base and re-applies them as LF — clean history.
Expected outcome
Most branches: no real conflicts, rebase applies cleanly.
If someone intentionally committed CRLF content (a test fixture that verifies line-ending handling, say), Git will flag it — rare in this codebase.
Windows devs — one-time local setup
Leaving
core.autocrlf=true(Windows default) is harmless — checkout converts LF→CRLF, commit converts back. Just causes^Mnoise in some editors. Set tofalseif you want parity with the repo.Don't do
merge.renormalize=true— same phantom-conflict storm as merge..gitattributes.Verification
🤖 Generated with Claude Code