Skip to content

Commit 65289e9

Browse files
rsbeckercagitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3013dff commit 65289e9

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Documentation/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ MAN7_TXT += gitworkflows.txt
3939
MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)
4040
MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT))
4141
MAN_HTML = $(patsubst %.txt,%.html,$(MAN_TXT))
42+
GIT_MAN_REF = master
4243

4344
OBSOLETE_HTML += everyday.html
4445
OBSOLETE_HTML += git-remote-helpers.html
@@ -437,14 +438,14 @@ require-manrepo::
437438
then echo "git-manpages repository must exist at $(MAN_REPO)"; exit 1; fi
438439

439440
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)
441442

442443
require-htmlrepo::
443444
@if test ! -d $(HTML_REPO); \
444445
then echo "git-htmldocs repository must exist at $(HTML_REPO)"; exit 1; fi
445446

446447
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)
448449

449450
print-man1:
450451
@for i in $(MAN1_TXT); do echo $$i; done

Documentation/install-doc-quick.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
repository=${1?repository}
55
destdir=${2?destination}
6+
GIT_MAN_REF=${3?master}
67

7-
head=master GIT_DIR=
8+
GIT_DIR=
89
for d in "$repository/.git" "$repository"
910
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
1112
then
1213
GIT_DIR="$d"
1314
export GIT_DIR
@@ -27,12 +28,12 @@ export GIT_INDEX_FILE GIT_WORK_TREE
2728
rm -f "$GIT_INDEX_FILE"
2829
trap 'rm -f "$GIT_INDEX_FILE"' 0
2930

30-
git read-tree $head
31+
git read-tree "$GIT_MAN_REF"
3132
git checkout-index -a -f --prefix="$destdir"/
3233

3334
if test -n "$GZ"
3435
then
35-
git ls-tree -r --name-only $head |
36+
git ls-tree -r --name-only "$GIT_MAN_REF" |
3637
xargs printf "$destdir/%s\n" |
3738
xargs gzip -f
3839
fi

0 commit comments

Comments
 (0)