Repository navigation
Check out text files with LF on every machine - #17
Merged
Merged
Conversation
Hash and immutable-file checks compare raw bytes, so a Windows clone with core.autocrlf=true could not rebuild its indexes: install_immutable found source_tokens.json converted to CRLF and refused it. The index already holds LF everywhere, so pinning the checkout needs no renormalization. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
On a Windows clone with
core.autocrlf=true(Git for Windows' default),scripts/build_indexes.pyfails:Checkout converts the file to CRLF, and
install_immutablecompares raw bytes against the LF it generates. With no index,/search/concordancereturns 500 and/corpus/layersreturns an empty list.Fix
Add
.gitattributeswith* text=auto eol=lf. It covers the whole repo because raw bytes are also hashed outsidecontent/:_resolver_hashreads files inapp/services/, and the psalm import reads source XML. Every text file is already LF in the index, so no files are renormalized. Images and archives stay binary.Testing
tests/unit/test_line_endings.pyfailed before the fix and passes after it.tests/unitpasses (636 tests).core.autocrlf=true: all text files check out as LF,build_indexes.pyexits 0,validate_content.pyreportserrors: [],/corpus/layersreturns["literal","lyric"], and/search/concordance?query=shepherdreturns 200.Existing Windows checkouts
Pulling this does not rewrite files Git already considers unchanged, so an existing CRLF checkout still fails the rebuild until it is refreshed. This worked in a test clone, but it discards uncommitted changes to tracked files, so commit them first:
A new clone also works.
🤖 Generated with Claude Code