#758239 git HTML documentation doesn't embed version number

#758239#5
Date:
2014-08-15 17:17:52 UTC
From:
To:
Unlike the manpages, git's HTML documentation does not include the
version number it was generated from.  (It does include a "last
modified" date.)

How about this patch?  With it applied, the HTML rendering of a
manpage ends with

	Version 2.1.0.rc2.3.g67de23d
	Last updated 2014-08-08 14:25:29 PDT

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
diff --git i/Documentation/Makefile w/Documentation/Makefile
index cea0e7a..94d55f4 100644
--- i/Documentation/Makefile
+++ w/Documentation/Makefile
@@ -305,13 +305,13 @@ clean:
 $(MAN_HTML): %.html : %.txt asciidoc.conf
 	$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
 	$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
-		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
+		$(ASCIIDOC_EXTRA) -arevnumber=$(GIT_VERSION) -o $@+ $< && \
 	mv $@+ $@

 $(OBSOLETE_HTML): %.html : %.txto asciidoc.conf
 	$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
 	$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
-		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
+		$(ASCIIDOC_EXTRA) -arevnumber=$(GIT_VERSION) -o $@+ $< && \
 	mv $@+ $@

 manpage-base-url.xsl: manpage-base-url.xsl.in
@@ -324,7 +324,7 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
 %.xml : %.txt asciidoc.conf
 	$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
 	$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
-		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
+		$(ASCIIDOC_EXTRA) -arevnumber=$(GIT_VERSION) -o $@+ $< && \
 	mv $@+ $@

 user-manual.xml: user-manual.txt user-manual.conf
@@ -339,7 +339,7 @@ technical/api-index.txt: technical/api-index-skel.txt \
 technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
 $(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt asciidoc.conf
 	$(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
-		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt
+		$(ASCIIDOC_EXTRA) -arevnumber=$(GIT_VERSION) $*.txt

 XSLT = docbook.xsl
 XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
diff --git i/Documentation/asciidoc.conf w/Documentation/asciidoc.conf
index 2c16c53..02e4dcc 100644
--- i/Documentation/asciidoc.conf
+++ w/Documentation/asciidoc.conf
@@ -79,7 +79,7 @@ template::[header-declarations]
 <refentrytitle>{mantitle}</refentrytitle>
 <manvolnum>{manvolnum}</manvolnum>
 <refmiscinfo class="source">Git</refmiscinfo>
-<refmiscinfo class="version">{git_version}</refmiscinfo>
+<refmiscinfo class="version">{revnumber}</refmiscinfo>
 <refmiscinfo class="manual">Git Manual</refmiscinfo>
 </refmeta>
 <refnamediv>