Skip to content

Add .gitattributes for consistent line-ending handling#8394

Merged
Groenbech96 merged 1 commit into
mainfrom
magnushar/fix-631442-gitattributes
Jun 2, 2026
Merged

Add .gitattributes for consistent line-ending handling#8394
Groenbech96 merged 1 commit into
mainfrom
magnushar/fix-631442-gitattributes

Conversation

@Groenbech96
Copy link
Copy Markdown
Contributor

@Groenbech96 Groenbech96 commented Jun 1, 2026

Without .gitattributes, line endings depend on each contributors local core.autocrlf setting (defaults to true on Windows, false on Linux). On cross-platform checkouts — e.g. a Windows enlistment mounted into a Linux container or WSL — every text file appears modified because the working tree has CRLF while blobs are LF.

Adds a minimal .gitattributes at the repo root with * text=auto to normalize text files consistently across platforms, plus binary markers so common binary file types are not normalized.

The parent NAV repo uses a similar approach and does not exhibit this issue.

Repro

  1. On Windows with default Git-for-Windows install (core.autocrlf=true globally), clone BCApps. Git writes CRLF to the working tree; blobs in .git/ are LF.
  2. From WSL or a Linux container with a bind mount, access the same checkout.
  3. git status --porcelain inside WSL/container lists hundreds of tracked files as modified.
  4. git diff <any-file> shows only CRLF/LF differences; git diff --ignore-cr-at-eol is empty.

AB#631442

Without .gitattributes, line endings depend on each contributor's local
core.autocrlf setting (defaults to true on Windows, false on Linux). On
cross-platform checkouts — e.g. a Windows enlistment mounted into a Linux
container or WSL — every text file appears modified because the working
tree has CRLF while blobs are LF.

Add a minimal .gitattributes at the repo root with `* text=auto` to
normalize text files consistently across platforms, plus binary markers
so common binary file types are not normalized.

The parent NAV repo uses a similar approach and does not exhibit this
issue.
@Groenbech96 Groenbech96 requested a review from a team as a code owner June 1, 2026 13:39
@github-actions github-actions Bot added this to the Version 29.0 milestone Jun 2, 2026
@Groenbech96 Groenbech96 enabled auto-merge (squash) June 2, 2026 09:10
@Groenbech96 Groenbech96 merged commit 5e408ec into main Jun 2, 2026
18 of 19 checks passed
@Groenbech96 Groenbech96 deleted the magnushar/fix-631442-gitattributes branch June 2, 2026 10:44
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.

3 participants