chore: add .gitattributes to normalize line endings#188
Merged
calesthio merged 1 commit intoJun 26, 2026
Conversation
Without a .gitattributes, line-ending normalization depends on each contributor's local core.autocrlf. On Windows checkouts this can materialize text files — and shell scripts like render-demo.sh — with CRLF, which breaks script shebangs and produces noisy cross-platform diffs. Add a root .gitattributes that: - defaults all text files to LF (* text=auto eol=lf) - pins shell scripts, Makefile and .env.example to LF explicitly - keeps .bat/.cmd as CRLF - marks image/video/audio/font assets as binary so Git never normalizes or diffs them Only the policy file is added; existing files are intentionally left unrenormalized to keep this change reviewable. Closes calesthio#187
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
Adds a root
.gitattributesto normalize line endings across platforms. Closes #187.Without it, normalization depends on each contributor's local
core.autocrlf. On Windows checkouts this can materialize text files — and shell scripts likerender-demo.sh— with CRLF, which breaks script shebangs and produces noisy cross-platform diffs. This is the same class of Windows friction already seen in #172 and #148.What it does
* text=auto eol=lf*.sh,Makefile,.env.example) to LF explicitly*.bat/*.cmdas CRLFbinaryso Git never normalizes or diffs themScope / safety
Only the policy file is added. Existing tracked files are intentionally left unrenormalized so the diff is a single new file and trivially reviewable. Maintainers can run
git add --renormalize .in a separate commit whenever they want to apply it repo-wide.Verified with
git check-attr:.shand.mdresolve totext+eol=lf;diagram.pngresolves tobinary(untouched).