all: disable Git line-ending conversion Add a .gitattributes file that marks all files as -text, matching the Go repository policy of preserving line endings exactly as committed. Without this, Git for Windows installations with core.autocrlf=true can check out testdata text files with CRLF endings. That changes the bytes read by tests such as x86/x86avxgen TestOutput, causing failures. Fixes golang/go#80086 Change-Id: Iecf2ac6d55906defbb2991258cb5231f489b9eb8 Reviewed-on: https://go-review.googlesource.com/c/arch/+/793240 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..995b904 --- /dev/null +++ b/.gitattributes
@@ -0,0 +1,12 @@ +# Treat all files in the Go repo as binary, with no git magic updating +# line endings. This produces predictable results in different environments. +# +# Windows users contributing to Go will need to use a modern version +# of git and editors capable of LF line endings. +# +# We'll prevent accidental CRLF line endings from entering the repo +# via the git-codereview gofmt checks and tests. +# +# See go.dev/issue/80086. + +* -text