From 5ad1c2d6a8f9eed7241de2b9d32217c6621c94cb Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 5 Jun 2026 13:54:44 -0700 Subject: [PATCH 1/2] Add .gitattributes and normalize line endings across repo - set CRLF as the default checkout encoding for this Windows-native project, with LF overrides for cross-platform formats (`.md`, `.json`, `.js`, `.txt`, `.patch`, git config files) - mark `src/PowerShell/ExternalModules/**` as `-text` to preserve vendored files byte-for-byte -- several are UTF-16 LE encoded - the remaining 1,753 staged files are a one-time re-normalization of git's internal LF object storage; `git diff --ignore-all-space` shows only `.gitattributes` as a real change Assisted-By: "claude my eyes right out" --- .gitattributes | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..9b82293bbd --- /dev/null +++ b/.gitattributes @@ -0,0 +1,28 @@ +# Default: CRLF on checkout - primary tooling is Visual Studio / PowerShell on Windows. +# Git always stores text as LF in the object store; eol= controls the working tree only. +* text=auto eol=crlf + +# Cross-platform formats - no Windows tooling owns these, LF is safer for external consumers +*.editorconfig text eol=lf +*.gitattributes text eol=lf +*.gitignore text eol=lf +*.json text eol=lf +*.js text eol=lf +*.md text eol=lf +*.patch text eol=lf +*.txt text eol=lf + +# Vendored external modules - preserve byte-for-byte as shipped upstream +# (some files are UTF-16 LE; text=auto would misidentify or corrupt them) +src/PowerShell/ExternalModules/** -text + +# Binary assets - suppress line-ending conversion and text diffs +*.cer binary +*.crt binary +*.dll binary +*.exe binary +*.gif binary +*.ico binary +*.msi binary +*.msix binary +*.png binary From cc0a04e6e1eeacccccb6c99a30983c8201b6007b Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 5 Jun 2026 15:48:24 -0700 Subject: [PATCH 2/2] Simplify .gitattributes - drop explicit LF overrides for `.md`, `.json`, `.js`, etc. -- `text=auto eol=crlf` handles those correctly; no tooling in this repo requires LF for those types - drop `src/PowerShell/ExternalModules/** -text` -- `text=auto` already detects UTF-16 LE files as binary natively - drop explicit `binary` entries -- redundant with `text=auto` binary detection - keep `*.patch text eol=lf` -- vcpkg applies these against LF source trees via `git apply`; CRLF patch content risks mismatched hunk context --- .gitattributes | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/.gitattributes b/.gitattributes index 9b82293bbd..36e0b0c7cb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,27 +2,6 @@ # Git always stores text as LF in the object store; eol= controls the working tree only. * text=auto eol=crlf -# Cross-platform formats - no Windows tooling owns these, LF is safer for external consumers -*.editorconfig text eol=lf -*.gitattributes text eol=lf -*.gitignore text eol=lf -*.json text eol=lf -*.js text eol=lf -*.md text eol=lf -*.patch text eol=lf -*.txt text eol=lf - -# Vendored external modules - preserve byte-for-byte as shipped upstream -# (some files are UTF-16 LE; text=auto would misidentify or corrupt them) -src/PowerShell/ExternalModules/** -text - -# Binary assets - suppress line-ending conversion and text diffs -*.cer binary -*.crt binary -*.dll binary -*.exe binary -*.gif binary -*.ico binary -*.msi binary -*.msix binary -*.png binary +# Patch files must stay LF - git apply matches content lines against the target source +# tree, which vcpkg manages as LF internally +*.patch text eol=lf