Skip to content

Add .gitattributes to pin line endings to LF - #49

Merged
tbeason merged 1 commit into
mainfrom
chore/normalize-line-endings
Sep 17, 2026
Merged

tbeason merged 1 commit into
mainfrom
chore/normalize-line-endings

Conversation

@tbeason

@tbeason tbeason commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Why

Without a .gitattributes, the stored line endings of each file depend on whichever contributor's core.autocrlf setting happened to commit it. That's how the sister repo DatabentoBinaryEncoding.jl drifted into a mix — 23 .jl files stored CRLF vs 20 LF, with even its two CI workflows split one each way — which silently turned a 1-line change into 93 lines of churn while preparing its v0.1.7 release (fixed in tbeason/DatabentoBinaryEncoding.jl#50).

This repository is already uniformly LF, so git add --renormalize . is a no-op here. This PR is purely preventive: it pins the invariant before it can drift.

What

  • * text=auto — LF becomes the canonical stored form for all detected text, independent of local git config. Working trees may still use CRLF on Windows.
  • *.dbn / *.dbz / *.zst / *.frag → binary, listed ahead of need. This package writes .dbn and .dbn.zst captures via stream_to_file, and any fixture added later should be exempt from EOL conversion by rule rather than by git's NUL-byte content heuristic.

No .git-blame-ignore-revs here, unlike the DBN PR — there's no renormalization commit to ignore.

Diff

One new file, 13 lines. No existing file is modified.

🤖 Generated with Claude Code

This repository is already uniformly LF, so `git add --renormalize .`
is a no-op here -- this is purely preventive. Without a .gitattributes,
the stored form of each file depends on whichever contributor's
core.autocrlf setting happened to commit it, which is how the sister
repository DatabentoBinaryEncoding.jl drifted into a CRLF/LF mix.

`* text=auto` makes LF canonical in the repository regardless of local
git config. Working trees may still use CRLF on Windows.

The binary patterns are listed ahead of need: this package writes .dbn
and .dbn.zst captures, and any fixture added later should be exempt from
EOL conversion by rule rather than by git's NUL-byte heuristic.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tbeason
tbeason merged commit ac77cc9 into main Sep 17, 2026
8 checks passed
@tbeason
tbeason deleted the chore/normalize-line-endings branch September 17, 2026 15:26
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