Check out YAML with LF so Dependabot stops rewriting every line - #3033
Merged
Conversation
The global rule is `* text=auto eol=crlf`: the repository stores LF, the working tree gets CRLF. Dependabot checks out the working-tree form, edits it, and commits those bytes without re-normalizing, so its blobs come back CRLF against our LF and every line reads as changed. Both Dependabot pull requests we have ever had look like this. #2986 was 328 changed lines where 11 were real, #3027 is a whole-file diff where 4 are real. There is no Dependabot setting for line endings, and `text eol=crlf` cannot store CRLF anyway, `text` always normalizes to LF on the way in. `eol=lf` for YAML makes the checkout and the stored form agree. No blob changes, they are already LF, and none of the 11 YAML files are PowerShell or test fixtures. pester/vscode-adapter and PowerShell/PSScriptAnalyzer already use eol=lf repo-wide. Verified with `git ls-files --eol`: after a fresh checkout the workflow files are i/lf w/lf, and `git add --renormalize .` touches nothing. 🤖
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.
Our global rule is
* text=auto eol=crlf: the repository stores LF, the working tree gets CRLF. Dependabot checks out the working-tree form, edits it, and commits those bytes without re-normalizing, so its blobs come back CRLF against our LF and every line reads as changed.Both Dependabot pull requests we have ever had look like this:
There is no Dependabot setting for line endings, and
text eol=crlfcannot store CRLF anyway, sincetextalways normalizes to LF on the way in. So the fix has to be on our side.eol=lffor YAML makes the checkout and the stored form agree. No blob changes, they are already LF, and none of the 11 YAML files are PowerShell or test fixtures. For reference, pester/vscode-adapter and PowerShell/PSScriptAnalyzer already useeol=lfrepo-wide, and PowerShell/PowerShell uses the same targeted-override pattern for*.shand a few scripts.Verified with
git ls-files --eol: after a fresh checkout the workflow files arei/lf w/lf, andgit add --renormalize .touches nothing.Once this lands,
@dependabot recreateon #3027 regenerates it with a clean diff.🤖