Skip to content

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

Open
Adarsh04Arun wants to merge 1 commit into
roostorg:mainfrom
Adarsh04Arun:fix/gitattributes-crlf-shell-scripts
Open

Fix shell scripts checked out with CRLF on Windows#451
Adarsh04Arun wants to merge 1 commit into
roostorg:mainfrom
Adarsh04Arun:fix/gitattributes-crlf-shell-scripts

Conversation

@Adarsh04Arun

@Adarsh04Arun Adarsh04Arun commented Aug 11, 2026

Copy link
Copy Markdown

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 line endings for shell scripts and Dockerfiles to improve consistency across development environments.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds .gitattributes rules that enforce LF line endings for shell scripts, Dockerfile, and Dockerfile variants.

Changes

Line Ending Attributes

Layer / File(s) Summary
Enforce LF line endings
.gitattributes
Adds LF line-ending rules for *.sh, Dockerfile, Dockerfile.*, and *.dockerfile files.

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

Suggested reviewers: ayubun, exbreder, haileyok, vinaysrao1

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: preventing shell scripts from using CRLF line endings on Windows.
✨ 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
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