fix: add .gitattributes so Windows checkouts do not corrupt binary maps - #4771
fix: add .gitattributes so Windows checkouts do not corrupt binary maps#4771eastwoodgrant wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughAdded a root ChangesBinary asset handling
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Without a .gitattributes, a default Windows clone (core.autocrlf=true, the Git for Windows installer default) applied LF->CRLF conversion to binary map .bin data on checkout: every 0x0A byte gained a 0x0D prefix, the file no longer matched width*height, and the game crashed on map load. Mark binary asset types (map data, images, audio, fonts) as `binary` so Git checks them out verbatim on every platform. Resolves openfrontio#4601 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
845d6b1 to
490b27b
Compare
| @@ -0,0 +1,30 @@ | |||
| # Prevent Git's text/EOL handling from corrupting binary assets. | |||
| # | |||
| # The repo previously had no .gitattributes, so on a default Windows clone | |||
There was a problem hiding this comment.
Could we remove this comment? That history is tracked in the issue and PR, I don't think we need it as a permanent comment too
Resolves #4601
Problem
The repo had no
.gitattributes, so on a default Windows clone (core.autocrlf=true, the Git for Windows installer default) checkout applied LF→CRLF conversion to binary map.bindata: every0x0Abyte gained a0x0Dprefix, the file no longer matchedwidth*height, and the game crashed on map load.Fix
Add a
.gitattributesmarking binary asset types (map data, images, audio, fonts) asbinary(a macro for-text -diff), so Git checks them out verbatim on every platform. Deliberately scoped to binaries only — no* text=auto, to avoid renormalizing existing text files.Verification
git check-attr -aon a.binreportsbinary: set,text: unset(verbatim);.svg/.tsremain unaffected.autocrlf=true), so it was verified viagit check-attrrather than a Windows checkout.Discord: granster9