Repository navigation
Fix shell scripts checked out with CRLF on Windows - #451
cassidyjames merged 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan includes up to 2 reviews per rolling hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe PR adds global ChangesLine Ending Attributes
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to The change enforces LF line endings for shell scripts at checkout, preventing Windows CRLF conversion from breaking container startup; no actionable merge-blocking risk remains beyond normal checks. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
cassidyjames
left a comment
There was a problem hiding this comment.
I agree with the sentiment here but think we could handle it much simpler by just normalizing line endings for all text files in one go.
Same as we did in Osprey: roostorg/osprey#451
Description
On Windows with
core.autocrlf=true(the Git for Windows default),*.shfilesare checked out with CRLF line endings. The shebang becomes
#!/bin/bash\r, andevery container that execs one fails with a misleading error:
This breaks the stock
docker compose uppath. Affected scripts includeentrypoint.sh,druid/specs/submit-specs.shandinit-minio-bucket.sh.The project already has an LF policy —
.pre-commit-config.yamlrunsmixed-line-ending --fix=lf— but it is only enforced at commit time.Nothing enforces LF at checkout time, which is where autocrlf breaks it.
This PR closes that half of the gap.
Why no
.shfiles are in this diffThe repository already stores LF. Verified with:
Only
\nappears — no\r. The CRLF is introduced purely on checkout, so.gitattributesalone is the complete fix and no file contents change.Verification
Before, on Windows:
After, on a fresh clone with this change:
Summary by CodeRabbit