Skip to content

Commit 4159c57

Browse files
peffJunio C Hamano
authored andcommitted
Documentation: robustify asciidoc GIT_VERSION replacement
Instead of using sed on the resulting file, we now have a git_version asciidoc attribute. This means that we don't pipe the output of asciidoc, which means we can detect build failures. Problem reported by Scott Lamb, solution suggested by Jonas Fonseca. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8e29f90 commit 4159c57

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Documentation/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ clean:
112112
%.html : %.txt
113113
rm -f $@+ $@
114114
$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
115-
$(ASCIIDOC_EXTRA) -o - $< | \
116-
sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' >$@+
115+
$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
117116
mv $@+ $@
118117

119118
%.1 %.5 %.7 : %.xml
@@ -122,8 +121,7 @@ clean:
122121
%.xml : %.txt
123122
rm -f $@+ $@
124123
$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
125-
$(ASCIIDOC_EXTRA) -o - $< | \
126-
sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' >$@+
124+
$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
127125
mv $@+ $@
128126

129127
user-manual.xml: user-manual.txt user-manual.conf

Documentation/asciidoc.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ template::[header-declarations]
4040
<refentrytitle>{mantitle}</refentrytitle>
4141
<manvolnum>{manvolnum}</manvolnum>
4242
<refmiscinfo class="source">Git</refmiscinfo>
43-
<refmiscinfo class="version">@@GIT_VERSION@@</refmiscinfo>
43+
<refmiscinfo class="version">{git_version}</refmiscinfo>
4444
<refmiscinfo class="manual">Git Manual</refmiscinfo>
4545
</refmeta>
4646
<refnamediv>

0 commit comments

Comments
 (0)