fix: force LF on *.txt so generated llms.txt stays clean on Windows#2289
Open
Olamiaca wants to merge 1 commit into
Open
fix: force LF on *.txt so generated llms.txt stays clean on Windows#2289Olamiaca wants to merge 1 commit into
Olamiaca wants to merge 1 commit into
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
.gitattributes pins eol=lf for every other generated/parsed text type (*.md, *.json, *.ts, setup, bin/*) but omits *.txt. gstack/llms.txt is regenerated as LF by ./setup's gen-llms-txt on every run, while Git for Windows sets core.autocrlf=true at the system level. The file is therefore reported modified forever, and /gstack-upgrade's `git stash` silently stashes it on every upgrade. Blob and worktree are both pure LF and `git diff` is empty, so the file is phantom-modified rather than content-modified. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Olamiaca
force-pushed
the
fix/gitattributes-txt-eol-lf
branch
from
July 17, 2026 10:02
7cdc6e7 to
3004811
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
On Windows,
git statusin a gstack install permanently reportsM gstack/llms.txt. Because/gstack-upgraderunsgit stashbeforegit reset --hard origin/main, every upgrade silently stashes this phantom change, accruing empty stashes and printingwarning: in the working copy of 'gstack/llms.txt', LF will be replaced by CRLF the next time Git touches it.Cause
.gitattributesalready pinstext eol=lffor every other generated/parsed text type —*.md,*.tmpl,*.yml,*.json,*.toml,*.ts,*.sh,setup,bin/*— and its own header comment says why:But there is no
*.txtrule.gstack/llms.txtis regenerated as LF by./setup'sgen-llms-txton every run, while the Git for Windows installer setscore.autocrlf=trueat the system level (C:/Program Files/Git/etc/gitconfig). So the file falls through to the CRLF expectation and is flagged dirty forever.Evidence
Both the committed blob and the worktree copy are pure LF (zero CR bytes), and
git diffis empty — the file is phantom-modified, not content-modified:Only
llms.txttrips it because./setuprewrites the file each run, resetting its mtime and forcing git to re-evaluate it. Other.txtfiles keep a matching stat cache and are never re-examined.Scope
*.txtmatches exactly two tracked files:gstack/llms.txt— the target.make-pdf/test/fixtures/combined-gate.expected.txt— already pure LF and clean, so unaffected. LF is also correct here: it is compared against generated output, and a CRLF fixture vs LF output would fail.No CI impact: on Linux runners
autocrlfis off and files are already LF, sotext eol=lfis a no-op there.Verification
With the rule in place,
git check-attr text eol -- gstack/llms.txtreportstext: set/eol: lf, and rewriting the file with identical LF content (what./setupdoes) leaves the worktree clean instead of dirty.Deliberately omitted
No VERSION bump and no CHANGELOG entry — those belong to the maintainer's
/shiprelease flow rather than a contributor's one-line fix.