Skip to content

Fix shell scripts checked out with CRLF on Windows - #451

Merged
cassidyjames merged 3 commits into
roostorg:mainfrom
Adarsh04Arun:fix/gitattributes-crlf-shell-scripts
Aug 17, 2026
Merged

cassidyjames merged 3 commits into
roostorg:mainfrom
Adarsh04Arun:fix/gitattributes-crlf-shell-scripts

Conversation

@Adarsh04Arun

@Adarsh04Arun Adarsh04Arun commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

On Windows with core.autocrlf=true (the Git for Windows default), *.sh files
are checked out with CRLF line endings. The shebang becomes #!/bin/bash\r, and
every container that execs one fails with a misleading error:

exec /osprey/entrypoint.sh: no such file or directory

This breaks the stock docker compose up path. Affected scripts include
entrypoint.sh, druid/specs/submit-specs.sh and init-minio-bucket.sh.

The project already has an LF policy — .pre-commit-config.yaml runs
mixed-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 .sh files are in this diff

The repository already stores LF. Verified with:

git show HEAD:entrypoint.sh | od -c | head -3

Only \n appears — no \r. The CRLF is introduced purely on checkout, so
.gitattributes alone is the complete fix and no file contents change.

Verification

Before, on Windows:

$ file entrypoint.sh
entrypoint.sh: Bourne-Again shell script, ASCII text executable, with CRLF line terminators
$ docker compose up
osprey-worker | exec /osprey/entrypoint.sh: no such file or directory

After, on a fresh clone with this change:

$ file entrypoint.sh
entrypoint.sh: Bourne-Again shell script, ASCII text executable
$ docker compose up   # worker starts normally

Summary by CodeRabbit

  • Chores
    • Standardized text file formatting to use consistent LF line endings across development environments.
    • Improved consistency when viewing, editing, and sharing text-based files across different operating systems.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 070a0f3e-945f-40b4-b75e-9e08942a810f

📥 Commits

Reviewing files that changed from the base of the PR and between d2b2284 and a5e1c38.

📒 Files selected for processing (1)
  • .gitattributes

Included review availability: Your plan includes up to 2 reviews per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PR adds global .gitattributes rules that normalize text files and enforce LF line endings.

Changes

Line Ending Attributes

Layer / File(s) Summary
Normalize text line endings
.gitattributes
Marks files as text and normalizes line endings to LF.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to a5e1c

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: ayubun

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: enforcing LF line endings for shell scripts on Windows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Adarsh04Arun Adarsh04Arun changed the title Fix shell scripts checked out with CRLF on Windows Imperative and descriptive, per AGENTS.md §Code review. Fix shell scripts checked out with CRLF on Windows Aug 11, 2026

@cassidyjames cassidyjames left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .gitattributes Resolved
@cassidyjames
cassidyjames merged commit a062929 into roostorg:main Aug 17, 2026
6 checks passed
@Adarsh04Arun
Adarsh04Arun deleted the fix/gitattributes-crlf-shell-scripts branch August 17, 2026 16:58
cassidyjames added a commit to roostorg/coop that referenced this pull request Aug 26, 2026
@cassidyjames cassidyjames added this to the 1.2.0 milestone Oct 7, 2026
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.

2 participants