Skip to content

Commit d4cd75f

Browse files
pks-tgitster
authored andcommitted
contrib/subtree: fix building docs
In a38edab (Makefile: generate doc versions via GIT-VERSION-GEN, 2024-12-06), we have refactored how we build our documentation by injecting the Git version into the Asciidoc and AsciiDoctor config files instead of doing so via arguments. As such, the original config files were removed, where the expectation is that they get generated via `GIT-VERSION-GEN` now. Whie the git-subtree(1) command part of "contrib/" also builds docs using these same config files, its Makefile wasn't adjusted accordingly and thus building the docs is broken. Fix this by using `GIT-VERSION-GEN` to generate those files. Reported-by: Renato Botelho <[email protected]> Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fbe8d30 commit d4cd75f

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

contrib/subtree/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
*~
2+
asciidoc.conf
3+
asciidoctor-extensions.rb
24
git-subtree
35
git-subtree.1
46
git-subtree.html

contrib/subtree/Makefile

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# The default target of this Makefile is...
22
all::
33

4+
-include ../../shared.mak
45
-include ../../config.mak.autogen
56
-include ../../config.mak
67

@@ -13,17 +14,16 @@ htmldir ?= $(prefix)/share/doc/git-doc
1314
../../GIT-VERSION-FILE: FORCE
1415
$(MAKE) -C ../../ GIT-VERSION-FILE
1516

16-
-include ../../GIT-VERSION-FILE
17-
1817
# this should be set to a 'standard' bsd-type install program
1918
INSTALL ?= install
2019
RM ?= rm -f
2120

2221
ASCIIDOC = asciidoc
23-
ASCIIDOC_CONF = -f ../../Documentation/asciidoc.conf
22+
ASCIIDOC_CONF = -f asciidoc.conf
2423
ASCIIDOC_HTML = xhtml11
2524
ASCIIDOC_DOCBOOK = docbook
2625
ASCIIDOC_EXTRA =
26+
ASCIIDOC_DEPS = asciidoc.conf
2727
XMLTO = xmlto
2828
XMLTO_EXTRA =
2929

@@ -32,8 +32,9 @@ ASCIIDOC = asciidoctor
3232
ASCIIDOC_CONF =
3333
ASCIIDOC_HTML = xhtml5
3434
ASCIIDOC_DOCBOOK = docbook
35-
ASCIIDOC_EXTRA += -I../../Documentation -rasciidoctor-extensions
35+
ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions
3636
ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
37+
ASCIIDOC_DEPS = asciidoctor-extensions.rb
3738
XMLTO_EXTRA += --skip-validation
3839
endif
3940

@@ -82,13 +83,13 @@ install-html: $(GIT_SUBTREE_HTML)
8283
$(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)
8384
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $^
8485

85-
$(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT)
86+
$(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT) $(ASCIIDOC_DEPS)
8687
$(ASCIIDOC) -b $(ASCIIDOC_DOCBOOK) -d manpage $(ASCIIDOC_CONF) \
87-
-agit_version=$(GIT_VERSION) $(ASCIIDOC_EXTRA) $^
88+
$(ASCIIDOC_EXTRA) $<
8889

89-
$(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT)
90+
$(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT) $(ASCIIDOC_DEPS)
9091
$(ASCIIDOC) -b $(ASCIIDOC_HTML) -d manpage $(ASCIIDOC_CONF) \
91-
-agit_version=$(GIT_VERSION) $(ASCIIDOC_EXTRA) $^
92+
$(ASCIIDOC_EXTRA) $<
9293

9394
$(GIT_SUBTREE_TEST): $(GIT_SUBTREE)
9495
cp $< $@
@@ -98,6 +99,12 @@ test: $(GIT_SUBTREE_TEST)
9899

99100
clean:
100101
$(RM) $(GIT_SUBTREE)
102+
$(RM) asciidoc.conf asciidoctor-extensions.rb
101103
$(RM) *.xml *.html *.1
102104

105+
asciidoc.conf: ../../Documentation/asciidoc.conf.in ../../GIT-VERSION-FILE
106+
$(QUIET_GEN)$(call version_gen,"$(shell pwd)/../..",$<,$@)
107+
asciidoctor-extensions.rb: ../../Documentation/asciidoctor-extensions.rb.in ../../GIT-VERSION-FILE
108+
$(QUIET_GEN)$(call version_gen,"$(shell pwd)/../..",$<,$@)
109+
103110
.PHONY: FORCE

0 commit comments

Comments
 (0)