Move test/.gitattributes to clang-tools-extra/test
authorAaron Puchert <aaronpuchert@alice-dsl.net>
Sun, 24 Apr 2022 20:30:25 +0000 (22:30 +0200)
committerAaron Puchert <aaronpuchert@alice-dsl.net>
Sun, 24 Apr 2022 20:30:25 +0000 (22:30 +0200)
It was probably accidentally added there, see the discussion on change
D97625. It is certainly without effect, to quote gitattributes(5):

    When deciding what attributes are assigned to a path, Git consults
    [...], `.gitattributes` file in the same directory as the path in
    question, and its parent directories up to the toplevel of the work
    tree [...]

Running `git check-attr -a` on the files in question shows that now the
settings are indeed effective whereas before they were not.

Lastly, lit ignores the file like any dotfile, see getTestsInDirectory
of FileBasedTest in llvm/utils/lit/lit/formats/base.py. This can be
verified with `llvm-lit --show-tests clang-tools-extra/test`.

clang-tools-extra/test/.gitattributes [new file with mode: 0644]
test/.gitattributes [deleted file]

diff --git a/clang-tools-extra/test/.gitattributes b/clang-tools-extra/test/.gitattributes
new file mode 100644 (file)
index 0000000..9d17a32
--- /dev/null
@@ -0,0 +1,19 @@
+# CRLF (Windows) line endings take two bytes instead of one, so any tests that
+# rely on or check fixed character -offset, Offset: or FileOffset: locations
+# will fail when run on input files checked out with different line endings.
+
+# Most test input files should use native line endings, to ensure that we run
+# tests against both line ending types.
+* text=auto
+
+# These test input files rely on one-byte Unix (LF) line-endings, as they use
+# fixed -offset, FileOffset:, or Offset: numbers in their tests.
+clang-apply-replacements/ClangRenameClassReplacements.cpp text eol=lf
+clang-apply-replacements/Inputs/basic/basic.h text eol=lf
+clang-apply-replacements/Inputs/format/no.cpp text eol=lf
+clang-apply-replacements/Inputs/format/yes.cpp text eol=lf
+clang-tidy/infrastructure/export-diagnostics.cpp text eol=lf
+
+# These test input files rely on two-byte Windows (CRLF) line endings.
+clang-apply-replacements/Inputs/crlf/crlf.cpp text eol=crlf
+clang-apply-replacements/Inputs/crlf/crlf.cpp.expected text eol=crlf
diff --git a/test/.gitattributes b/test/.gitattributes
deleted file mode 100644 (file)
index 9d17a32..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# CRLF (Windows) line endings take two bytes instead of one, so any tests that
-# rely on or check fixed character -offset, Offset: or FileOffset: locations
-# will fail when run on input files checked out with different line endings.
-
-# Most test input files should use native line endings, to ensure that we run
-# tests against both line ending types.
-* text=auto
-
-# These test input files rely on one-byte Unix (LF) line-endings, as they use
-# fixed -offset, FileOffset:, or Offset: numbers in their tests.
-clang-apply-replacements/ClangRenameClassReplacements.cpp text eol=lf
-clang-apply-replacements/Inputs/basic/basic.h text eol=lf
-clang-apply-replacements/Inputs/format/no.cpp text eol=lf
-clang-apply-replacements/Inputs/format/yes.cpp text eol=lf
-clang-tidy/infrastructure/export-diagnostics.cpp text eol=lf
-
-# These test input files rely on two-byte Windows (CRLF) line endings.
-clang-apply-replacements/Inputs/crlf/crlf.cpp text eol=crlf
-clang-apply-replacements/Inputs/crlf/crlf.cpp.expected text eol=crlf