Repository navigation
Pin LF line endings with a root .gitattributes - #13
Merged
Merged
Conversation
A Windows clone with core.autocrlf=true checked every text file out with CRLF, so plugins/dojo-protocol/PROTOCOL.md was 2014 bytes on disk against 1987 in git. The website's gen_proof.py --check counts bytes on disk, so every /proof figure read high and the deploy guard refused the deploy unless DOJO_PLUGINS_DIR pointed at an LF export. * text=auto eol=lf, with the common text types named and binaries marked. The index was already all LF: renormalizing stages no content changes. 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.
What
A root
.gitattributesthat pins LF line endings:* text=auto eol=lf, with*.md,*.py,*.sh,*.json,*.jsonl,*.js,*.ts,*.tsx,*.txt,*.yamland*.ymlnamed as text, and common binary types markedbinary. Plus one CHANGELOG line under 2.4.0 / Fixed.Why
On a Windows machine whose system git config sets
core.autocrlf=true, a checkout of this repo gets CRLF files:plugins/dojo-protocol/PROTOCOL.mdis 2014 bytes on disk against 1987 in git. The website'sscripts/gen_proof.py --checkcounts bytes on disk, so every /proof figure read high, and since DojoGenesis/website#7 the deploy guard refuses a deploy unless the auditor passes. Until now a Windows deploy neededDOJO_PLUGINS_DIRpointed at an LF export (git -c core.autocrlf=false archive HEAD | tar -x). With this file, a plain clone is byte-exact.Before choosing, I checked:
README.md,PORTABILITY.mdandscripts/README-release.mdstate no line-ending policy.git ls-files --eolonorigin/main: all 1146 non-empty files arei/lfand none is binary (-text). The 1147th,scripts/tests_suite/__init__.py, is empty. No.bat,.cmdor.ps1files, so nothing needs to stay CRLF.PREREG-2026-10-17-evidence.md.sha256) already hashes "CRLF as LF", so it is unaffected either way.Verification
Run on Windows 11 with
core.autocrlf=true(system config), in a freshgit worktree add --detach <worktree> fix/pin-lf-line-endings.1. PROTOCOL.md checks out LF
The same
w/count on the CRLF checkout ofmainwas 1131w/crlf.2. gen_proof --check matches disk
Control, the same command against the existing CRLF checkout of
main:3. Renormalize stages nothing
This passes every tracked path explicitly, the same set
git add --renormalize .covers (renormalize only touches tracked files), because dojo-gates' staging guard blocks a baregit add ... .. It was also run in the authoring worktree before the commit: the only staged change was the 4-line CHANGELOG edit.4. Release check: no regression; on this machine it can't reach PASS on
maineitherscripts/release-check.shwas run on this branch and on a fresh worktree oforigin/main(c676050), with the same environment for each. This Windows machine has no Python 3.9 and no local denylist lists, so neither tree can reachOVERALL: PASShere.OVERALL: FAIL (0 fail, 20 error, 1 warn-ok, 0 warn). All 20 errors arepython 3.9 interpreter not found. The rows that ran pass on both:mod:dojo-router(27 tests),mod:dojo-meter(54),mod:dojo-verify(109),face-parity(CONTRACT PASS) andalways-on;plugin-lintis WARN-OK (known quarantine baseline).DOJO_PY39set to Python 3.10.7, to exercise the Python rows: both trees giveOVERALL: FAIL (8 fail, 1 error, 1 warn-ok, 1 warn).lintand all ninevalidate:*rows pass. The unittest FAIL rows andself-testFAIL are Windows test-portability failures, identical onmain.denylistis ERROR because the lists are missing. One row differs:The one fewer failure is
test_session_start.TestInjection.test_protocol_md_canonical, which fails on the CRLF checkout and passes on the LF one.A release-check run on the Mac (Python 3.9 at
/usr/bin/python3, denylist lists present) is the one that can showOVERALL: PASS.After merging
The shared Windows checkout keeps its CRLF files on disk after the merge. A plain
git -C C:\Users\cruzr\CoworkPluginsByDojoGenesis checkout -- .is not enough: git skips every file whose stat info still matches the index. Tested on a CRLF worktree of this branch, it left all 1146 filesw/crlf. Touching the tracked files first makes git rewrite them. Oncegit status --shortprints nothing (this overwrites local edits), run in Git Bash:On the test worktree, the last line printed
1147 w/lfand1 w/none, with PROTOCOL.md at 1987 bytes and a clean status. After that,DOJO_PLUGINS_DIRcan point at the checkout directly, with no LF export needed.🤖 Generated with Claude Code