Repository navigation
chore: 钉住 LF,杜绝工作树与安装副本的行尾漂移 - #4
Merged
Merged
Conversation
本仓字节是产品的一部分。没有 .gitattributes 时,本机 core.autocrlf=true 会在 每次检出把工作树换成 CRLF;而三端 Marketplace 直接指向工作树,于是运行端装到 CRLF、仓库存 LF、符合性测试与语料预算又按 LF 规范化计算——量的和发的不是同一 份东西,且不同检出时机结果不同。 2026-08-15 实测到这个形状:同一个 0.2.6,从新写入的工作树装出来是 LF,合并后 重新检出的工作树是 CRLF,plugin_release 的整树指纹据此判 modified。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 15, 2026
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.
怎么发现的
合并上一个 PR 后重新检出,
plugin_release check立刻把orchestrated-collaboration 0.2.6判为modified。逐文件比对:差值 10 与 222,正好等于各自的行数——CRLF 与 LF。
根因
本仓
core.autocrlf = true,且没有.gitattributes。于是:\r\n → \n规范化,按 LF 计量的和发的不是同一份东西,而且不同检出时机会得到不同结果——同一个
0.2.6,从新写入的工作树装出来是 LF,合并后重新检出的工作树是 CRLF。三端 Marketplace 直接指向工作树,所以这不是纸面问题:运行端实际装到什么,取决于本机 git 配置和上一次检出时机。
修法
* text=auto eol=lf,然后重新检出工作树。仓库、工作树、安装副本、所有字节统计从此同一口径。git add --renormalize只动了.gitattributes一个文件——说明已提交内容本来就是 LF,漂的一直只是工作树。验证
规范化后 7 个插件全部被判
modified(工作树 LF vs 安装 CRLF),逐个用release --no-bump重装,7/7 指纹逐字节一致。两份符合性测试通过。