Skip to content

chore: check out every text file with LF line endings - #1169

Open
devohmycode wants to merge 1 commit into
DietrichGebert:mainfrom
devohmycode:chore/gitattributes-lf
Open

devohmycode wants to merge 1 commit into
DietrichGebert:mainfrom
devohmycode:chore/gitattributes-lf

Conversation

@devohmycode

Copy link
Copy Markdown
Contributor

Fixes #1150

Problem

Without a .gitattributes, Git for Windows checks text files out with CRLF while the index holds LF. Tests that split a file on '\n' then keep a trailing \r on Windows only (#1124), and scripts/build-openclaw-skills.js, which writes LF, leaves its 6 copies marked modified with no diff after every run.

Fix

.gitattributes with * text=auto eol=lf. The index is already all LF, so nothing is renormalized.

Checks (Windows 11)

  • A fresh checkout has no CRLF file left (161 of 167 text files were CRLF before).
  • build-openclaw-skills.js leaves git status clean.
  • npm test passes as before, apart from the pandas test that needs pandas installed locally.
  • hooks/ponytail-statusline.ps1 parses and runs with LF.
  • An existing checkout keeps its CRLF files until the next checkout, without showing them as modified.

The repo had no .gitattributes, so Git for Windows checked text files
out with CRLF while the index holds LF. A test that splits a file on
'\n' then keeps a trailing '\r' on Windows only (DietrichGebert#1124), and
build-openclaw-skills.js, which writes LF, leaves its copies marked
modified with no diff after every run. eol=lf gives every checkout the
same bytes as the index.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows checkouts get CRLF files: the repo has no .gitattributes

1 participant