fix(gitattributes): pin *.txt to LF - #2527
Closed
mlaniak wants to merge 1 commit into
Closed
Conversation
.gitattributes pins LF for every other text format in the repo (*.md, *.tmpl, *.yml, *.yaml, *.json, *.toml, *.sh, *.ts, extensionless scripts, even the hash-pinned diagram-render dist files). *.txt is the one text format left unpinned. On Windows with core.autocrlf=true, that means the two tracked .txt files are rewritten to CRLF at checkout and then read as permanently modified: gstack/llms.txt +174 bytes make-pdf/test/fixtures/combined-gate.expected.txt +20 bytes git status is never clean, and /gstack-upgrade's 'git stash' step saves a phantom stash on every upgrade — one that pops back to an empty diff. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
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 |
9 tasks
Owner
|
Thank you — this was absorbed on main (credited in the v1.6x CHANGELOG entries; roster in PR #2604). Closing. |
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.
One line added to
.gitattributes:Why
.gitattributesalready pins LF for every other text format in the repo —*.md,*.tmpl,*.yml,*.yaml,*.json,*.toml,*.sh,*.bash,setup,bin/*,**/scripts/*,*.ts/tsx/js/mjs/cjs, and the hash-pinnedlib/diagram-render/dist/*.*.txtis the one text format left out.On Windows with
core.autocrlf=true, the two tracked.txtfiles get rewritten to CRLF at checkout, sogit statusis never clean in a fresh clone.Repro
Fresh clone of
main,core.autocrlf=true, comparing blob bytes to worktree bytes:Exactly one byte per line, and
README.mdis the control: it is pinned by*.md text eol=lfand comes out clean. With this patch both.txtfiles also come out at delta 0.User-visible symptom
git statusreportsgstack/llms.txtas modified forever. Because/gstack-upgraderunsgit stashbeforegit reset --hard, every upgrade saves a phantom stash — one whose diff against its own parent is empty. The user is then told togit stash popto recover changes that never existed.Scope
Only the two files above are affected today. I checked
make-pdf/test/fixtures/combined-gate.expected.txtsince it is an expected-output fixture, butcopyPasteGateruns the text throughnormalize()andcollapseWhitespace(), so I could not produce a test failure from the CRLF — this is a cleanliness fix, not a test fix.Note for existing checkouts
The attribute only affects future checkouts. Anyone with a dirty tree today needs a one-time renormalize:
Verified on Windows (Git for Windows,
core.autocrlf=true) againstmain@ v1.61.0.0.