Skip to content

Commit

Permalink
Prevent line ending conversion in repos (#333)
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Michael Kubacki <[email protected]>
  • Loading branch information
makubacki authored May 14, 2024
1 parent db418ae commit 1c0d6f1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .sync/Files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,28 @@ group:
microsoft/mu_tiano_plus
microsoft/mu_feature_mm_supv
# Git Templates - .gitattributes
- files:
- source: .sync/git_templates/gitattributes_template.txt
dest: .gitattributes
repos: |
microsoft/mu
microsoft/mu_basecore
microsoft/mu_common_intel_min_platform
microsoft/mu_feature_config
microsoft/mu_feature_debugger
microsoft/mu_feature_dfci
microsoft/mu_feature_ipmi
microsoft/mu_feature_mm_supv
microsoft/mu_feature_uefi_variable
microsoft/mu_oem_sample
microsoft/mu_plus
microsoft/mu_rust_hid
microsoft/mu_silicon_arm_tiano
microsoft/mu_silicon_intel_tiano
microsoft/mu_tiano_platforms
microsoft/mu_tiano_plus
# GitHub Templates - Contributing
- files:
- source: .sync/github_templates/contributing/CONTRIBUTING.md
Expand Down
1 change: 1 addition & 0 deletions .sync/git_templates/gitattributes_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* -text

0 comments on commit 1c0d6f1

Please sign in to comment.