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

[PATCH 4/6] diff-options.txt: move monospace markup out of attribute

From
MÅMartin Ågren <martin.agren@gmail.com>
Date
May 13, 2021, 18:17 UTC
Message-ID
<f6241315a4d90185882a247d1c81ed7ee595d9a9.1620928059.git.martin.agren@gmail.com>
In-Reply-To
<cover.1620928059.git.martin.agren@gmail.com>

git-log.txt and git-show.txt want to use different defaults for the `--no-diff-merges` option. They do this by defining a "diff-merges-default" attribute as, e.g., `off` (with backticks), which is then referenced in the common diff-options.txt.

AsciiDoc renders the default in monospace, as wanted, but Asciidoctor renders the backticks literally.

Pull the formatting into diff-options.txt and define "diff-merges-default" without any quotation or markup. We can't write `{diff-merges-default)` with backticks since that would render as "{diff-merges-default}", but we can use +{diff-merges-default}+ -- both Asciidoc and Asciidoctor do the substitution and the parsing of the plusses in the order we want.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 Documentation/diff-options.txt | 2 +-
 Documentation/git-log.txt      | 2 +-
 Documentation/git-show.txt     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 530d115914..6eb8bfff5d 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -37,7 +37,7 @@ ifdef::git-log[]
 --diff-merges=(off|none|on|first-parent|1|separate|m|combined|c|dense-combined|cc)::
 --no-diff-merges::
 	Specify diff format to be used for merge commits. Default is
-	{diff-merges-default} unless `--first-parent` is in use, in which case
+	+{diff-merges-default}+ unless `--first-parent` is in use, in which case
 	`first-parent` is the default.
 +
 --diff-merges=(off|none):::
diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 1bbf865a1b..19560650bf 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -115,7 +115,7 @@ is when `--first-parent` is in use, in which case `first-parent` is
 the default format.
 
 :git-log: 1
-:diff-merges-default: `off`
+:diff-merges-default: off
 include::diff-options.txt[]
 
 include::diff-generate-patch.txt[]
diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt
index 2b1bc7288d..f8341e51c0 100644
--- a/Documentation/git-show.txt
+++ b/Documentation/git-show.txt
@@ -51,7 +51,7 @@ The options below can be used to change the way `git show` generates
 diff output.
 
 :git-log: 1
-:diff-merges-default: `dense-combined`
+:diff-merges-default: dense-combined
 include::diff-options.txt[]
 
 include::diff-generate-patch.txt[]
-- 
2.31.1.751.gd2f1c929bd
Previous: Martin ÅgrenNext: Martin Ågren
Message 12 of 22 in “AsciiDoc vs Asciidoctor, once again”
  1. 0/6 AsciiDoc vs Asciidoctor, once againMartin Ågren, May 13, 2021
  2. 1/6 git-http-push.txt,git-send-pack.txt: avoid single quoteMartin Ågren, May 13, 2021
  3. 2/6 git-range-diff.txt: avoid single quotesMartin Ågren, May 13, 2021
  4. 3/6 git-check-ref-format.txt: avoid single quoteMartin Ågren, May 13, 2021
  5. Eric SunshineMay 13, 2021
  6. Martin ÅgrenMay 13, 2021
  7. Junio C HamanoMay 13, 2021
  8. Martin ÅgrenMay 14, 2021
  9. Felipe ContrerasMay 14, 2021
  10. Jeff KingMay 14, 2021
  11. Martin ÅgrenMay 14, 2021
  12. 4/6 diff-options.txt: move monospace markup out of attributeMartin Ågren, May 13, 2021
  13. 5/6 git-svn.txt: change verse to listing blockMartin Ågren, May 13, 2021
  14. 6/6 Doc: use two backticks for monospace, not backtick+apostropheMartin Ågren, May 13, 2021
  15. Junio C HamanoMay 13, 2021
  16. Martin ÅgrenMay 14, 2021
  17. Felipe ContrerasMay 14, 2021
  18. Felipe ContrerasMay 14, 2021
  19. Martin ÅgrenMay 14, 2021
  20. Felipe ContrerasMay 14, 2021
  21. Martin ÅgrenMay 14, 2021
  22. Felipe ContrerasMay 14, 2021

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.