Files
Martin Vogel 32633bab9a fix(build): LF contract for extensionless git hooks + a line-ending guard
The *.sh eol=lf rule landed via #1314, but the git hooks
(scripts/git-hooks/commit-msg, scripts/hooks/pre-commit) are extensionless
and were still at the mercy of core.autocrlf. Add their explicit entries,
plus the contract test from #1272 wired as scripts/test.sh Step 0t: every
shell entrypoint (*.sh + both hook directories) must carry an eol=lf
attribute, with a matched-zero-files guard so a broken glob can never pass
vacuously.

Distilled from #1272: the diagnosis (CRLF checkouts breaking shebangs under
WSL/MSYS), the hook-file coverage, and the guard design are @xumian520's;
verified RED without the *.sh rule (105 uncovered entrypoints) and green
with it (107 files).

Co-Authored-By: xumian520 <126989134+xumian520@users.noreply.github.com>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-08-18 11:21:36 +02:00

14 lines
722 B
Plaintext

# Shell scripts must stay LF: with git's Windows default (core.autocrlf=true)
# they check out as CRLF and bash inside the build containers rejects them.
*.sh text eol=lf
# Vendored tree-sitter grammars — machine-generated, hide from stats and diffs
internal/cbm/vendored/grammars/**/parser.c linguist-generated=true diff=false
internal/cbm/vendored/grammars/**/scanner.c linguist-generated=true diff=false
# Shell entrypoints must check out LF everywhere: a CRLF shebang line breaks
# them under WSL/MSYS (`bash\r: no such file`). The *.sh rule covers scripts;
# the git hooks are extensionless and need explicit entries. (#1272)
scripts/git-hooks/commit-msg text eol=lf
scripts/hooks/pre-commit text eol=lf