Skip to content

chore: enforce LF line endings for container entrypoints#12181

Merged
benbarclay merged 1 commit into
NousResearch:mainfrom
bluefishs:chore/normalize-docker-line-endings
Jun 4, 2026
Merged

chore: enforce LF line endings for container entrypoints#12181
benbarclay merged 1 commit into
NousResearch:mainfrom
bluefishs:chore/normalize-docker-line-endings

Conversation

@bluefishs

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a .gitattributes rule that locks LF line endings for shell scripts, the Dockerfile, and docker/entrypoint.sh.

Preventive, not corrective. The tree at v2026.4.16 is already LF — this change only takes effect if a contributor on Windows (with core.autocrlf=true, the Git-for-Windows default) touches these files in a future PR and git would otherwise convert them to CRLF on checkout.

Related Issue

None — this is a forward-looking hardening PR with no current user-visible bug. Happy to close if maintainers would rather address only on a repro.

Type of Change

  • ♻️ Refactor (no behavior change)

Changes Made

  • .gitattributes: add text eol=lf rules for *.sh, Dockerfile, *.dockerfile, and the specific docker/entrypoint.sh.

How to Test

On a Windows host with core.autocrlf=true (Git for Windows default):

# Without this PR — checkout introduces CRLF
git clone <repo> repro && cd repro
file docker/entrypoint.sh
# -> "... with CRLF line terminators"

# With this PR — git enforces LF on checkout
# -> "... executable"  (no CRLF)

The failure mode this prevents: COPYing a CRLF-ended docker/entrypoint.sh into a Linux image yields ENTRYPOINT errors like /opt/hermes/docker/entrypoint.sh: not found because the kernel treats the trailing \r as part of the interpreter path.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (chore: ...)
  • I searched for existing PRs — no existing .gitattributes hardening PR.
  • My PR contains only changes related to this hardening (single-file .gitattributes edit).
  • pytest tests/ -q not run — .gitattributes does not affect any Python code path.
  • No tests added — line-ending behavior is host-environment-dependent and not suitable for in-repo test coverage.

Cross-platform

  • The rule is intentionally no-op on non-Windows (POSIX hosts already check out LF). No runtime behavior changes.

Windows contributors checking out on NTFS with git's default core.autocrlf
will end up with CRLF in docker/entrypoint.sh. When COPY'd into the image
and invoked as ENTRYPOINT, the kernel interprets the trailing \r as part of
the interpreter path, producing a confusing 'no such file or directory'
despite the file being present and executable.

Lock LF for the usual suspects (*.sh, Dockerfile, *.dockerfile, and the
specific docker/entrypoint.sh). The existing tree is already LF; this is
preventive against future Windows regressions only.
@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change P3 Low — cosmetic, nice to have area/docker Docker image, Compose, packaging labels Apr 23, 2026
bluefishs added a commit to bluefishs/hermes-agent that referenced this pull request Apr 24, 2026
- docs/plans/upstream-sync-cadence.md: per-release-tag sync rhythm
  (replacing monthly), check command, conflict handling, escalation
- docs/plans/upstream-feature-eval-2026-04-18.md: evaluate /steer
  (adopt), execute_code project/strict (default accept, re-eval with
  ADR-0017), Tool Gateway (decline)
- docs/plans/upstream-pr-web-build.md: PR draft and checklist used to
  submit NousResearch#12180 and NousResearch#12181
@benbarclay benbarclay merged commit 6ad0152 into NousResearch:main Jun 4, 2026
davidgut1982 pushed a commit to davidgut1982/hermes-agent that referenced this pull request Jun 5, 2026
…h#12181)

Windows contributors checking out on NTFS with git's default core.autocrlf
will end up with CRLF in docker/entrypoint.sh. When COPY'd into the image
and invoked as ENTRYPOINT, the kernel interprets the trailing \r as part of
the interpreter path, producing a confusing 'no such file or directory'
despite the file being present and executable.

Lock LF for the usual suspects (*.sh, Dockerfile, *.dockerfile, and the
specific docker/entrypoint.sh). The existing tree is already LF; this is
preventive against future Windows regressions only.
changman pushed a commit to changman/hermes-agent that referenced this pull request Jun 10, 2026
…h#12181)

Windows contributors checking out on NTFS with git's default core.autocrlf
will end up with CRLF in docker/entrypoint.sh. When COPY'd into the image
and invoked as ENTRYPOINT, the kernel interprets the trailing \r as part of
the interpreter path, producing a confusing 'no such file or directory'
despite the file being present and executable.

Lock LF for the usual suspects (*.sh, Dockerfile, *.dockerfile, and the
specific docker/entrypoint.sh). The existing tree is already LF; this is
preventive against future Windows regressions only.
alt-glitch pushed a commit that referenced this pull request Jun 14, 2026
Windows contributors checking out on NTFS with git's default core.autocrlf
will end up with CRLF in docker/entrypoint.sh. When COPY'd into the image
and invoked as ENTRYPOINT, the kernel interprets the trailing \r as part of
the interpreter path, producing a confusing 'no such file or directory'
despite the file being present and executable.

Lock LF for the usual suspects (*.sh, Dockerfile, *.dockerfile, and the
specific docker/entrypoint.sh). The existing tree is already LF; this is
preventive against future Windows regressions only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docker Docker image, Compose, packaging P3 Low — cosmetic, nice to have type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants