Skip to content

Check out YAML with LF so Dependabot stops rewriting every line - #3033

Merged
nohwnd merged 1 commit into
mainfrom
ci/gitattributes-yml-lf
Sep 5, 2026
Merged

Check out YAML with LF so Dependabot stops rewriting every line#3033
nohwnd merged 1 commit into
mainfrom
ci/gitattributes-yml-lf

Conversation

@nohwnd

@nohwnd nohwnd commented Sep 5, 2026

Copy link
Copy Markdown
Member

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:

PR diff real changes
#2986 (closed) 328 insertions 11
#3027 (open) whole file 4

There is no Dependabot setting for line endings, and text eol=crlf cannot store CRLF anyway, since text always normalizes to LF on the way in. So the fix has to be on our side.

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. For reference, pester/vscode-adapter and PowerShell/PSScriptAnalyzer already use eol=lf repo-wide, and PowerShell/PowerShell uses the same targeted-override pattern for *.sh and a few scripts.

Verified with git ls-files --eol: after a fresh checkout the workflow files are i/lf w/lf, and git add --renormalize . touches nothing.

Once this lands, @dependabot recreate on #3027 regenerates it with a clean diff.

🤖

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.

🤖
@nohwnd
nohwnd merged commit e023a2f into main Sep 5, 2026
12 of 13 checks passed
@nohwnd
nohwnd deleted the ci/gitattributes-yml-lf branch September 5, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants