Skip to content

Enforce LF line endings with .gitattributes - #7

Merged
bonelifer merged 1 commit into
masterfrom
lf-line-endings
Sep 28, 2026
Merged

bonelifer merged 1 commit into
masterfrom
lf-line-endings

Conversation

@bonelifer

Copy link
Copy Markdown
Contributor

Summary

  • Changes * text=auto to * text=auto eol=lf in .gitattributes, so text files are always stored with LF endings.
  • Adds binary rules for image types (png, jpg, jpeg, gif, webp, ico) so their bytes are never converted.
  • Existing export-ignore and other rules are kept as they were.
  • Converts .gitignore to LF. It mixed CRLF, lone CR and LF line endings, and the lone CRs made Git treat it as a binary file.

Test plan

  • Claude ran git add --renormalize . after the change: apart from the file(s) converted above, every file was already stored with LF, so nothing else changes.

Investigated and written by Claude on behalf of William Jacoby (bonelifer).

"* text=auto eol=lf" so text files are stored with LF, plus binary rules
for image types so their bytes are never converted. Existing
export-ignore rules are kept.

Also converts .gitignore to LF: it mixed CRLF, CR and LF endings, and
the lone CRs made Git treat it as a binary file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bonelifer
bonelifer merged commit da21533 into master Sep 28, 2026
7 checks passed
@bonelifer
bonelifer deleted the lf-line-endings branch September 28, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant