Files
magic/.gitattributes
T
Darryl L. MilesandClaude Opus 4.8 92d13c9894 build: enforce LF on build inputs via .gitattributes; drop sed CR-stripping
npm/build.sh stripped CRs from configure and every scripts/ file before each
WASM build.  Its purpose was purely to survive a Windows checkout with
core.autocrlf=true (which rewrites LF->CRLF, and bash/make then reject CRLF) --
not reproducible packaging.  No tracked build input is CRLF today
(`git ls-files --eol` shows only the incidental appimage/rsc/magic.svg), so it
never fired on a normal checkout, and it mutated the source tree to do it.

Add .gitattributes `eol=lf` for configure, scripts/**, *.sh, *.mak, *.mak.in
and Makefile.in.  Attributes override core.autocrlf, so git always checks these
out as LF regardless of platform -- the authoritative fix -- and the source tree
is never rewritten by the build.  Remove sed_strip_cr and its call sites.

Verified: git check-attr reports eol=lf for configure/scripts/*/*.sh/rules.mak/
Makefile.in; build.sh parses cleanly.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-26 14:54:11 -04:00

20 lines
574 B
Plaintext

*.c filter=header
*.h filter=header
*.cpp filter=header
*.tcl filter=header
*.scm filter=header
Makefile filter=header
*.gds diff=gds
# Keep build/shell scripts and makefiles LF even when checked out on Windows
# (git core.autocrlf=true), or the shell and make reject CRLF. .gitattributes
# overrides core.autocrlf, so this is the authoritative fix and the WASM build
# (npm/build.sh) no longer needs to strip CRs from the source tree.
/configure text eol=lf
/scripts/** text eol=lf
*.sh text eol=lf
*.mak text eol=lf
*.mak.in text eol=lf
Makefile.in text eol=lf