Add .gitattributes: *.sh text eol=lf for Windows clones (#19) #21
No reviewers
Labels
No Label
blocked
bounced
in-progress
in-review
manual-only
needs-guidance
netplay
p1
p2
p3
rust
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: pbwraith/gopher64-netplay#21
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "issue-19"
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?
Add
.gitattributesso every Windows clone gets LF in the repo's shell scriptsThe repo ships three shell scripts (
scripts/gate.sh,data/icon/generate.sh,data/shader/output.sh) and no.gitattributes. Git for Windows defaults tocore.autocrlf=true, so a plain Windows clone checks those files out with CRLFand
scripts/gate.shdies at exec with/usr/bin/env: 'bash\r': No such file or directory(EXIT=127) — which reads like a broken script even though thecommitted blobs are byte-clean. This repo root
.gitattributesasserts*.sh text eol=lfso every clone gets clean scripts.Diff vs
main: one new file,.gitattributes(7 lines) only.Branch rebased onto current
main(8a46ac5).Verification (fresh clones,
core.autocrlf=trueset explicitly)BEFORE — fresh clone of
main(no.gitattributes) withcore.autocrlf=true:AFTER — fresh clone of this branch with
core.autocrlf=true:Committed blobs were already byte-clean (
git show <branch>:scripts/gate.sh | tr -cd '\r' | wc -c= 0), so no renormalization commit is needed; theattributes file only governs future checkouts. Existing CRLF working copies
need the documented forced re-checkout (
rm -f .git/index && git reset --hard HEAD).Out of scope per the issue: no change to
scripts/gate.shcontents or buildconfiguration, and the full cargo gate remains blocked by the known disk-space
issue (gitea-worker-ops#24) — this change is verifiable by inspection and a
fresh clone.
Closes #19
Merged - correct, and it documents its own limits
.gitattributeswith*.sh text eol=lf. Seven lines, no code, no buildimpact.
I checked the thing that usually makes this change a half-fix: whether the
already-committed blobs are dirty, using
tr -cd '\r' | wc -c(notgrep -c $'\r', which is broken in this Git Bash and returns the line count):The blob is already clean, so no
git add --renormalizecommit is needed andnone is missing. This is purely preventive for future Windows clones.
The comment in the file also states the trap correctly and unprompted --
that git will not rewrite a working copy whose blob is unchanged, so existing
clones need
rm -f .git/index && git reset --hard HEAD. That is exactly rightand is the part people usually get wrong.
Gate, against the composed MERGE RESULT
Not each PR alone --
main+ !21 + !22 + !14 merged into one warm clone on thereview box (WSL), then
./scripts/gate.sh:Control on
origin/main@8a46ac5in the same clone:gate_exit=0, butstep 3 ran 0 tests. So this set also makes gate step 3 non-vacuous for the
first time -- 0 -> 4 real tests.