]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gitattributes: mark AsciiDoc files as LF-only
authorbrian m. carlson <sandals@crustytoothpaste.net>
Mon, 20 Jan 2025 01:56:01 +0000 (01:56 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Jan 2025 20:56:05 +0000 (12:56 -0800)
In a future commit, we'll move the AsciiDoc documentation files to the
".adoc" extension rather than the extension ".txt".  We need these files
to use only LF because they are read by generate-cmdlist.sh using the
read builtin.

If we allow CRLF here, the CR at the end of the line is treated as part
of the synopsis, since a POSIX shell doesn't consider it special like
LF.  In that case, we generate synopsis strings in C that contain a CR,
which the compiler does not like because it believes that the double
quote string terminator is missing, and as a consequence, compilation
fails.

Because we rely on LF-only endings here to compile successfully and we
want Git to continue to be able to compile on Windows, mark these files
as LF-only in the .gitattributes file.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.gitattributes

index 158c3d45c4c10cb19c7d3fb02d6bfdaf7a1794f1..b38cfd499b363c9c38ec2fd9bd2e116748937c55 100644 (file)
@@ -8,6 +8,7 @@
 *.bat text eol=crlf
 CODE_OF_CONDUCT.md -whitespace
 /Documentation/**/*.txt text eol=lf
+/Documentation/**/*.adoc text eol=lf
 /command-list.txt text eol=lf
 /GIT-VERSION-GEN text eol=lf
 /mergetools/* text eol=lf