install-doc-quick: allow specifying what ref to install

We allow the builders, who want to install the preformatted manpages and html documents, to specify where in their filesystem these two repositories are stored. Let them also specify which ref (or even a revision) to grab the preformatted material from. Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Randall S. Becker committed Dec 9, 2017 at 17:07 UTC 65289e9dcdd05f23e871d5aea1c90f217f581f53
2 files changed +8 -6
Documentation/Makefile
+3 -2
@@ -39,6 +39,7 @@ MAN7_TXT += gitworkflows.txt
39 MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)
40 MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT))
41 MAN_HTML = $(patsubst %.txt,%.html,$(MAN_TXT))
42 +GIT_MAN_REF = master
43
44 OBSOLETE_HTML += everyday.html
45 OBSOLETE_HTML += git-remote-helpers.html
@@ -437,14 +438,14 @@ require-manrepo::
438 then echo "git-manpages repository must exist at $(MAN_REPO)"; exit 1; fi
439
440 quick-install-man: require-manrepo
440 - '$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(MAN_REPO) $(DESTDIR)$(mandir)
441 + '$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(MAN_REPO) $(DESTDIR)$(mandir) $(GIT_MAN_REF)
442
443 require-htmlrepo::
444 @if test ! -d $(HTML_REPO); \
445 then echo "git-htmldocs repository must exist at $(HTML_REPO)"; exit 1; fi
446
447 quick-install-html: require-htmlrepo
447 - '$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(HTML_REPO) $(DESTDIR)$(htmldir)
448 + '$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(HTML_REPO) $(DESTDIR)$(htmldir) $(GIT_MAN_REF)
449
450 print-man1:
451 @for i in $(MAN1_TXT); do echo $$i; done
Documentation/install-doc-quick.sh
+5 -4
@@ -3,11 +3,12 @@
3
4 repository=${1?repository}
5 destdir=${2?destination}
6 +GIT_MAN_REF=${3?master}
7
7 -head=master GIT_DIR=
8 +GIT_DIR=
9 for d in "$repository/.git" "$repository"
10 do
10 - if GIT_DIR="$d" git rev-parse refs/heads/master >/dev/null 2>&1
11 + if GIT_DIR="$d" git rev-parse "$GIT_MAN_REF" >/dev/null 2>&1
12 then
13 GIT_DIR="$d"
14 export GIT_DIR
@@ -27,12 +28,12 @@ export GIT_INDEX_FILE GIT_WORK_TREE
28 rm -f "$GIT_INDEX_FILE"
29 trap 'rm -f "$GIT_INDEX_FILE"' 0
30
30 -git read-tree $head
31 +git read-tree "$GIT_MAN_REF"
32 git checkout-index -a -f --prefix="$destdir"/
33
34 if test -n "$GZ"
35 then
35 - git ls-tree -r --name-only $head |
36 + git ls-tree -r --name-only "$GIT_MAN_REF" |
37 xargs printf "$destdir/%s\n" |
38 xargs gzip -f
39 fi