Skip to content

Add .gitattributes and normalize line endings to LF#307

Merged
erikdarlingdata merged 1 commit intodevfrom
chore/normalize-line-endings
May 4, 2026
Merged

Add .gitattributes and normalize line endings to LF#307
erikdarlingdata merged 1 commit intodevfrom
chore/normalize-line-endings

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Add .gitattributes that pins LF for source/config files and CRLF for Windows-only scripts (.ps1, .psm1, .cmd, .bat).
  • Run git add --renormalize . so the existing tree matches what .gitattributes declares.

Why

The working tree kept showing "uncommitted changes" on dev (5 files: WaitStats.json, BenefitScorer.cs, WaitStatsConfig.cs, two .csprojs) that were pure CRLF↔LF drift — git diff --ignore-cr-at-eol was empty. With no .gitattributes and no core.autocrlf policy, editors were re-saving as CRLF while the repo stored LF, producing phantom diffs.

This commit normalizes once so future checkouts/saves stay clean.

Scope

  • 1 new file: .gitattributes
  • 115 files re-staged with no content changes (CRLF → LF only). Diff is exactly 36,772 insertions / 36,772 deletions — symmetric, as expected for an EOL-only change. Verify with:
    git diff dev...chore/normalize-line-endings --ignore-cr-at-eol --stat
    
    which should report .gitattributes only.

Test plan

  • git diff dev...HEAD --ignore-cr-at-eol --stat shows .gitattributes only
  • Solution still builds on Windows after merge
  • git status is clean immediately after a fresh checkout

🤖 Generated with Claude Code

Adds a .gitattributes that pins LF in the repo for source/config and
CRLF for Windows-only scripts (.ps1/.cmd/.bat), then runs
`git add --renormalize .` to apply it to existing files.

Eliminates the recurring "phantom uncommitted changes" caused by
editors re-saving files with CRLF when the repo stores LF.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata force-pushed the chore/normalize-line-endings branch from a1a358f to d51e00a Compare May 4, 2026 23:41
@erikdarlingdata erikdarlingdata mentioned this pull request May 4, 2026
3 tasks
@erikdarlingdata erikdarlingdata merged commit e99bf4f into dev May 4, 2026
2 checks passed
@erikdarlingdata erikdarlingdata deleted the chore/normalize-line-endings branch May 4, 2026 23:44
@erikdarlingdata erikdarlingdata mentioned this pull request May 4, 2026
4 tasks
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