Skip to content

Commit fcbebfd

Browse files
committed
docs: Update install-doc-quick
The preformatted documentation pages live in their own repositories these days. Adjust the installation procedure to the updated layout. Tested-by: Stefan Naewe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 939ca96 commit fcbebfd

File tree

3 files changed

+46
-50
lines changed

3 files changed

+46
-50
lines changed

Documentation/Makefile

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ MANPAGE_XSL = manpage-normal.xsl
4646
XMLTO_EXTRA =
4747
INSTALL?=install
4848
RM ?= rm -f
49-
DOC_REF = origin/man
50-
HTML_REF = origin/html
49+
MAN_REPO = ../../git-manpages
50+
HTML_REPO = ../../git-htmldocs
5151

5252
infodir?=$(prefix)/share/info
5353
MAKEINFO=makeinfo
@@ -327,12 +327,23 @@ $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
327327
install-webdoc : html
328328
'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST)
329329

330+
# You must have a clone of git-htmldocs and git-manpages repositories
331+
# next to the git repository itself for the following to work.
332+
330333
quick-install: quick-install-man
331334

332-
quick-install-man:
333-
'$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(DOC_REF) $(DESTDIR)$(mandir)
335+
require-manrepo::
336+
@if test ! -d $(MAN_REPO); \
337+
then echo "git-manpages repository must exist at $(MAN_REPO)"; exit 1; fi
338+
339+
quick-install-man: require-manrepo
340+
'$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(MAN_REPO) $(DESTDIR)$(mandir)
341+
342+
require-htmlrepo::
343+
@if test ! -d $(HTML_REPO); \
344+
then echo "git-htmldocs repository must exist at $(HTML_REPO)"; exit 1; fi
334345

335-
quick-install-html:
336-
'$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(HTML_REF) $(DESTDIR)$(htmldir)
346+
quick-install-html: require-htmlrepo
347+
'$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(HTML_REPO) $(DESTDIR)$(htmldir)
337348

338349
.PHONY: FORCE

Documentation/install-doc-quick.sh

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
11
#!/bin/sh
2-
# This requires a branch named in $head
3-
# (usually 'man' or 'html', provided by the git.git repository)
4-
set -e
5-
head="$1"
6-
mandir="$2"
7-
SUBDIRECTORY_OK=t
8-
USAGE='<refname> <target directory>'
9-
. "$(git --exec-path)"/git-sh-setup
10-
cd_to_toplevel
2+
# This requires git-manpages and/or git-htmldocs repositories
113

12-
test -z "$mandir" && usage
13-
if ! git rev-parse --verify "$head^0" >/dev/null; then
14-
echo >&2 "head: $head does not exist in the current repository"
15-
usage
4+
repository=${1?repository}
5+
destdir=${2?destination}
6+
7+
head=master GIT_DIR=
8+
for d in "$repository/.git" "$repository"
9+
do
10+
if GIT_DIR="$d" git rev-parse refs/heads/master >/dev/null 2>&1
11+
then
12+
GIT_DIR="$d"
13+
export GIT_DIR
14+
break
15+
fi
16+
done
17+
18+
if test -z "$GIT_DIR"
19+
then
20+
echo >&2 "Neither $repository nor $repository/.git is a repository"
21+
exit 1
1622
fi
1723

18-
GIT_INDEX_FILE=`pwd`/.quick-doc.index
19-
export GIT_INDEX_FILE
24+
GIT_WORK_TREE=$(pwd)
25+
GIT_INDEX_FILE=$(pwd)/.quick-doc.$$
26+
export GIT_INDEX_FILE GIT_WORK_TREE
2027
rm -f "$GIT_INDEX_FILE"
2128
trap 'rm -f "$GIT_INDEX_FILE"' 0
2229

2330
git read-tree $head
24-
git checkout-index -a -f --prefix="$mandir"/
31+
git checkout-index -a -f --prefix="$destdir"/
2532

26-
if test -n "$GZ"; then
33+
if test -n "$GZ"
34+
then
2735
git ls-tree -r --name-only $head |
28-
xargs printf "$mandir/%s\n" |
36+
xargs printf "$destdir/%s\n" |
2937
xargs gzip -f
3038
fi
3139
rm -f "$GIT_INDEX_FILE"

INSTALL

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -139,34 +139,11 @@ Issues of note:
139139
uses some compatibility wrappers to work on AsciiDoc 8. If you have
140140
AsciiDoc 7, try "make ASCIIDOC7=YesPlease".
141141

142-
Alternatively, pre-formatted documentation is available in
143-
"html" and "man" branches of the git repository itself. For
144-
example, you could:
145-
146-
$ mkdir manual && cd manual
147-
$ git init
148-
$ git fetch-pack git://git.kernel.org/pub/scm/git/git.git man html |
149-
while read a b
150-
do
151-
echo $a >.git/$b
152-
done
153-
$ cp .git/refs/heads/man .git/refs/heads/master
154-
$ git checkout
155-
156-
to checkout the pre-built man pages. Also in this repository:
157-
158-
$ git checkout html
159-
160-
would instead give you a copy of what you see at:
161-
162-
http://www.kernel.org/pub/software/scm/git/docs/
163-
164142
There are also "make quick-install-doc", "make quick-install-man"
165143
and "make quick-install-html" which install preformatted man pages
166-
and html documentation.
167-
This does not require asciidoc/xmlto, but it only works from within
168-
a cloned checkout of git.git with these two extra branches, and will
169-
not work for the maintainer for obvious chicken-and-egg reasons.
144+
and html documentation. To use these build targets, you need to
145+
clone two separate git-htmldocs and git-manpages repositories next
146+
to the clone of git itself.
170147

171148
It has been reported that docbook-xsl version 1.72 and 1.73 are
172149
buggy; 1.72 misformats manual pages for callouts, and 1.73 needs

0 commit comments

Comments
 (0)