From 7b8a74f39cbd58b514dce963e7a571904508661b Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sun, 25 Mar 2007 13:56:49 +0200 Subject: [PATCH 1/3] Documentation: Replace @@GIT_VERSION@@ in documentation Include GIT-VERSION-FILE and replace @@GIT_VERSION@@ in the HTML and XML asciidoc output. The documentation doesn't depend on GIT-VERSION-FILE so it will not be automatically rebuild if nothing else changed. [jc: fixing the case for interrupted build] Signed-off-by: Frank Lichtenheld Signed-off-by: Junio C Hamano --- Documentation/Makefile | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index 7db3fb992f..e82596dcdf 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -65,6 +65,11 @@ install: man $(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir) +../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE + $(MAKE) -C ../ GIT-VERSION-FILE + +-include ../GIT-VERSION-FILE + # # Determine "include::" file references in asciidoc files. # @@ -91,17 +96,25 @@ $(cmds_txt): cmd-list.perl $(MAN1_TXT) git.7 git.html: git.txt core-intro.txt clean: - rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep + rm -f *.xml *.xml+ *.html *.html+ *.1 *.7 howto-index.txt howto/*.html doc.dep rm -f $(cmds_txt) %.html : %.txt - $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $< + rm -f $@+ $@ + $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \ + $(ASCIIDOC_EXTRA) -o - $< | \ + sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' >$@+ + mv $@+ $@ %.1 %.7 : %.xml xmlto -m callouts.xsl man $< %.xml : %.txt - $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf $< + rm -f $@+ $@ + $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \ + $(ASCIIDOC_EXTRA) -o - $< | \ + sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' >$@+ + mv $@+ $@ user-manual.xml: user-manual.txt user-manual.conf $(ASCIIDOC) -b docbook -d book $< @@ -132,3 +145,5 @@ install-webdoc : html quick-install: sh ./install-doc-quick.sh $(DOC_REF) $(mandir) + +.PHONY: .FORCE-GIT-VERSION-FILE From 7ef195ba3efe0ffa815e12afc4cb1e39a21ddfb4 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sun, 25 Mar 2007 13:56:50 +0200 Subject: [PATCH 2/3] Documentation: Add version information to man pages Override the [header] macro of asciidoc's docbook backend to add version information to the generated man pages. Signed-off-by: Frank Lichtenheld Signed-off-by: Junio C Hamano --- Documentation/asciidoc.conf | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf index 44b1ce4c6b..a86c31d00a 100644 --- a/Documentation/asciidoc.conf +++ b/Documentation/asciidoc.conf @@ -31,6 +31,23 @@ ifdef::backend-docbook[] {title#} endif::backend-docbook[] +ifdef::backend-docbook[] +[header] +template::[header-declarations] + + +{mantitle} +{manvolnum} +Git +@@GIT_VERSION@@ +Git Manual + + + {manname} + {manpurpose} + +endif::backend-docbook[] + ifdef::backend-xhtml11[] [gitlink-inlinemacro] {target}{0?({0})} From d3d4fa86319a0bf97752e285907a8d34a2824951 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 26 Mar 2007 23:45:23 -0700 Subject: [PATCH 3/3] Documentation: unbreak user-manual. The previous one broke generated xml files for anything but manpages, as it took the header for manpage unconditionally. This fixes it. Signed-off-by: Junio C Hamano --- Documentation/asciidoc.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf index a86c31d00a..fa7dc94845 100644 --- a/Documentation/asciidoc.conf +++ b/Documentation/asciidoc.conf @@ -31,6 +31,7 @@ ifdef::backend-docbook[] {title#} endif::backend-docbook[] +ifdef::doctype-manpage[] ifdef::backend-docbook[] [header] template::[header-declarations] @@ -47,6 +48,7 @@ template::[header-declarations] {manpurpose} endif::backend-docbook[] +endif::doctype-manpage[] ifdef::backend-xhtml11[] [gitlink-inlinemacro]