git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/5] gitattributes: mark AsciiDoc files as LF-only

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jan 20, 2025, 01:56 UTC
Message-ID
<20250120015603.1980991-4-sandals@crustytoothpaste.net>
In-Reply-To
<20250120015603.1980991-1-sandals@crustytoothpaste.net>

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>
---
 .gitattributes | 1 +
 1 file changed, 1 insertion(+)
diff --git a/.gitattributes b/.gitattributes
index 158c3d45c4..b38cfd499b 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -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
Previous: brian m. carlsonNext: brian m. carlson
Message 3 of 19 in “Convert AsciiDoc files to .adoc extension”
  1. 0/5 Convert AsciiDoc files to .adoc extensionbrian m. carlson, Jan 20, 2025
  2. 2/5 editorconfig: add .adoc extensionbrian m. carlson, Jan 20, 2025
  3. 3/5 gitattributes: mark AsciiDoc files as LF-onlybrian m. carlson, Jan 20, 2025
  4. 1/5 doc: update gitignore for .adoc extensionbrian m. carlson, Jan 20, 2025
  5. 4/5 doc: use .adoc extension for AsciiDoc filesbrian m. carlson, Jan 20, 2025
  6. Jean-Noël AvilaJan 20, 2025
  7. brian m. carlsonJan 20, 2025
  8. Junio C HamanoJan 20, 2025
  9. Jean-Noël AvilaJan 21, 2025
  10. M HickfordFeb 6, 2025
  11. Junio C HamanoFeb 6, 2025
  12. Junio C HamanoFeb 6, 2025
  13. D. Ben KnobleFeb 7, 2025
  14. Junio C HamanoFeb 7, 2025
  15. Junio C HamanoFeb 7, 2025
  16. brian m. carlsonFeb 7, 2025
  17. 5/5 Remove obsolete ".txt" extensions for AsciiDoc filesbrian m. carlson, Jan 20, 2025
  18. M HickfordJan 20, 2025
  19. D. Ben KnobleJan 20, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.