microsoft / mu_devops

Project Mu Developer Operations
https://microsoft.github.io/mu/
Other
27 stars 25 forks source link

Prevent line ending conversion in repos #333

Closed makubacki closed 6 months ago

makubacki commented 7 months ago

Unsets the text attribute on all files to prevent their line endings from being normalized.

See https://git-scm.com/docs/gitattributes for background.

This was previously accomplished solely by instructing users to set core.autocrlf to false. However, that does not translate to pipelines and setting in a pipeline requires the system level git configuration to be modified prior to checkout. Git configs cannot be checked into to a repo and automatically used for security reasons.

This is a simple way to check the change into the repo so it applies for all users including pipelines to prevent line ending conversion.

This allows plugins like LineEndingCheck to produce similar results in pipelines on Linux and Windows agents.

makubacki commented 7 months ago

Tested in the following mu_basecore Windows agent pipeline runs:

makubacki commented 7 months ago

On hold to let this PR verify there's no unexpected impact before rolling out to other repos.

https://github.com/microsoft/mu_basecore/pull/809

makubacki commented 6 months ago

On hold to let this PR verify there's no unexpected impact before rolling out to other repos.

microsoft/mu_basecore#809

No negative consequences seen from that PR, so I'm going to merge this PR now.