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 <stefan.naewe@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Nov 8, 2011 at 10:17 UTC fcbebfdd33bf8b6cc802300f81089148d413eec9
3 files changed +46 -50
Documentation/Makefile
+17 -6
@@ -46,8 +46,8 @@ MANPAGE_XSL = manpage-normal.xsl
46 XMLTO_EXTRA =
47 INSTALL?=install
48 RM ?= rm -f
49 -DOC_REF = origin/man
50 -HTML_REF = origin/html
49 +MAN_REPO = ../../git-manpages
50 +HTML_REPO = ../../git-htmldocs
51
52 infodir?=$(prefix)/share/info
53 MAKEINFO=makeinfo
@@ -327,12 +327,23 @@ $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
327 install-webdoc : html
328 '$(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST)
329
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 +
333 quick-install: quick-install-man
334
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
345
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)
348
349 .PHONY: FORCE
Documentation/install-doc-quick.sh
+26 -18
@@ -1,31 +1,39 @@
1 #!/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
3
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
22 fi
23
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
27 rm -f "$GIT_INDEX_FILE"
28 trap 'rm -f "$GIT_INDEX_FILE"' 0
29
30 git read-tree $head
24 -git checkout-index -a -f --prefix="$mandir"/
31 +git checkout-index -a -f --prefix="$destdir"/
32
26 -if test -n "$GZ"; then
33 +if test -n "$GZ"
34 +then
35 git ls-tree -r --name-only $head |
28 - xargs printf "$mandir/%s\n" |
36 + xargs printf "$destdir/%s\n" |
37 xargs gzip -f
38 fi
39 rm -f "$GIT_INDEX_FILE"
INSTALL
+3 -26
@@ -139,34 +139,11 @@ Issues of note:
139 uses some compatibility wrappers to work on AsciiDoc 8. If you have
140 AsciiDoc 7, try "make ASCIIDOC7=YesPlease".
141
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 -
142 There are also "make quick-install-doc", "make quick-install-man"
143 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.
147
148 It has been reported that docbook-xsl version 1.72 and 1.73 are
149 buggy; 1.72 misformats manual pages for callouts, and 1.73 needs