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

Re: [PATCH 1/2] doc: add an option to have Asciidoctor build man pages directly

From
Jeff King <peff@peff.net>
Date
May 12, 2021, 06:30 UTC
Message-ID
<YJt1/DO1cXNTRNxK@coredump.intra.peff.net>
In-Reply-To
<YJt0Dv7HP2VnLLwv@coredump.intra.peff.net>
On Wed, May 12, 2021 at 02:22:06AM -0400, Jeff King wrote:
> With that change, plus a patch I'll send in a minute, it's easy to run
> doc-diff on the result.

And here that is (note that if you don't apply the flags fix I showed, then doc-diff gets confused, because it expects back-to-back runs of "make" to handle the changed flags correctly).

Feel free to add it to your series if it helps (I had originally thought it would just be a one-off to look at the output, but there are enough changes, both correctness and style, that it may be useful to have this option around).

-- >8 --
Subject: [PATCH] doc-diff: support --asciidoctor-direct mode

The new option enables both asciidoctor as well as its direct-to-manpage mode that skips xmlto. This lets you view the rendered difference between the two pipelines with something like:

  ./doc-diff --from-asciidoctor --to-asciidoctor-direct HEAD HEAD

Note that we have to add quotes when passing around $makemanflags, as it now may contain whitespace due to multiple arguments (but the deference inside render_tree must remain unquoted, because it wants to perform whitespace splitting to get the individual arguments back).

Signed-off-by: Jeff King <peff@peff.net>
---
 Documentation/doc-diff | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/Documentation/doc-diff b/Documentation/doc-diff
index 1694300e50..2c774ee954 100755
--- a/Documentation/doc-diff
+++ b/Documentation/doc-diff
@@ -17,10 +17,13 @@ f			force rebuild; do not rely on cached results
 c,clean			cleanup temporary working files
 from-asciidoc		use asciidoc with the 'from'-commit
 from-asciidoctor	use asciidoctor with the 'from'-commit
+from-asciidoctor-direct use asciidoctor without xmlto for 'from'-commit
 asciidoc		use asciidoc with both commits
 to-asciidoc		use asciidoc with the 'to'-commit
 to-asciidoctor		use asciidoctor with the 'to'-commit
+to-asciidoctor-direct   use asciidoctor without xmlto for 'to'-commit
 asciidoctor		use asciidoctor with both commits
+asciidoctor-direct      use asciidoctor without xml for both commits
 cut-footer		cut away footer
 "
 SUBDIRECTORY_OK=1
@@ -55,6 +58,13 @@ do
 	--asciidoc)
 		from_program=-asciidoc
 		to_program=-asciidoc ;;
+	--from-asciidoctor-direct)
+		from_program=-asciidoctor-direct ;;
+	--to-asciidoctor-direct)
+		to_program=-asciidoctor-direct ;;
+	--asciidoctor-direct)
+		from_program=-asciidoctor-direct
+		to_program=-asciidoctor-direct ;;
 	--cut-footer)
 		cut_footer=-cut-footer ;;
 	--)
@@ -112,6 +122,10 @@ construct_makemanflags () {
 	elif test "$1" = "-asciidoctor"
 	then
 		echo USE_ASCIIDOCTOR=YesPlease
+	elif test "$1" = "-asciidoctor-direct"
+	then
+		echo USE_ASCIIDOCTOR=YesPlease
+		echo USE_ASCIIDOCTOR_MANPAGE=YesPlease
 	fi
 }
 
@@ -181,6 +195,6 @@ render_tree () {
 	fi
 }
 
-render_tree $from_oid $from_dir $from_makemanflags &&
-render_tree $to_oid $to_dir $to_makemanflags &&
+render_tree $from_oid $from_dir "$from_makemanflags" &&
+render_tree $to_oid $to_dir "$to_makemanflags" &&
 git -C $tmp/rendered diff --no-index "$@" $from_dir $to_dir
-- 
2.31.1.1027.g87a751368c
Previous: Jeff KingNext: Jeff King
Message 23 of 45 in “doc: use asciidoctor to build man pages directly”
  1. doc: use asciidoctor to build man pages directlyFelipe Contreras, May 11, 2021
  2. brian m. carlsonMay 11, 2021
  3. Felipe ContrerasMay 12, 2021
  4. 1/2 doc: add an option to have Asciidoctor build man pages directlybrian m. carlson, May 12, 2021
  5. 2/2 doc: remove GNU_ROFF optionbrian m. carlson, May 12, 2021
  6. Eric SunshineMay 12, 2021
  7. brian m. carlsonMay 12, 2021
  8. Felipe ContrerasMay 12, 2021
  9. brian m. carlsonMay 14, 2021
  10. Felipe ContrerasMay 15, 2021
  11. Martin ÅgrenMay 13, 2021
  12. Bagas SanjayaMay 12, 2021
  13. Felipe ContrerasMay 12, 2021
  14. brian m. carlsonMay 13, 2021
  15. Felipe ContrerasMay 14, 2021
  16. Felipe ContrerasMay 15, 2021
  17. Felipe ContrerasMay 12, 2021
  18. brian m. carlsonMay 13, 2021
  19. Felipe ContrerasMay 14, 2021
  20. Bagas SanjayaMay 12, 2021
  21. brian m. carlsonMay 13, 2021
  22. Jeff KingMay 12, 2021
  23. Jeff KingMay 12, 2021
  24. Jeff KingMay 12, 2021
  25. Felipe ContrerasMay 12, 2021
  26. Martin ÅgrenMay 13, 2021
  27. Felipe ContrerasMay 13, 2021
  28. Eric SunshineMay 12, 2021
  29. Jeff KingMay 12, 2021
  30. Martin ÅgrenMay 14, 2021
  31. 0/2 Asciidoctor native manpage buildsbrian m. carlson, May 14, 2021
  32. 1/2 doc: add an option to have Asciidoctor build man pages directlybrian m. carlson, May 14, 2021
  33. Junio C HamanoMay 14, 2021
  34. Jeff KingMay 14, 2021
  35. Felipe ContrerasMay 14, 2021
  36. brian m. carlsonMay 14, 2021
  37. Felipe ContrerasMay 14, 2021
  38. Felipe ContrerasMay 14, 2021
  39. Felipe ContrerasMay 14, 2021
  40. brian m. carlsonMay 14, 2021
  41. Felipe ContrerasMay 14, 2021
  42. 2/2 doc: remove GNU_ROFF optionbrian m. carlson, May 14, 2021
  43. Felipe ContrerasMay 14, 2021
  44. brian m. carlsonMay 14, 2021
  45. 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.