Enforce LF line endings for everything that runs in the VM #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
On a Windows checkout with
core.autocrlf=true(the Git for Windows default),the scripts come out with CRLF:
agentbox createandagentbox updatecopytemplate/*into the Linux VM withsbx cp. A script with CRLF fails there with/usr/bin/env: 'bash\r': No such file or directory. The same applies tobin/agentboxandlib/when run fromGit Bash, which tolerates it less consistently.
This is not Windows-only: anyone who clones with autocrlf, or edits in an editor
that writes CRLF, produces a broken template.
Proposal
Add
.gitattributes:Add an offline test that fails when any file under
bin/,lib/,scripts/,template/orinstall.shcontains\r.Optionally:
install.shand the code paths thatsbx cpfiles into the VM refuse a filecontaining
\r, with a message pointing at.gitattributes. That catches aworking tree that was checked out before the attribute existed.
Done when
core.autocrlf=trueproduces LF files.tests/run-tests.shhas a test for CR bytes and it passes.