]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/install-doc-quick.sh
i18n: avoid parenthesized string as array initializer
[thirdparty/git.git] / Documentation / install-doc-quick.sh
CommitLineData
6538d1ef
EW
1#!/bin/sh
2# This requires a branch named in $head
3# (usually 'man' or 'html', provided by the git.git repository)
4set -e
5head="$1"
6mandir="$2"
7SUBDIRECTORY_OK=t
8USAGE='<refname> <target directory>'
dc0f7054 9. "$(git --exec-path)"/git-sh-setup
00d8c518 10cd_to_toplevel
6538d1ef
EW
11
12test -z "$mandir" && usage
5be60078 13if ! git rev-parse --verify "$head^0" >/dev/null; then
6538d1ef
EW
14 echo >&2 "head: $head does not exist in the current repository"
15 usage
16fi
17
18GIT_INDEX_FILE=`pwd`/.quick-doc.index
19export GIT_INDEX_FILE
20rm -f "$GIT_INDEX_FILE"
00d8c518
JH
21trap 'rm -f "$GIT_INDEX_FILE"' 0
22
5be60078
JH
23git read-tree $head
24git checkout-index -a -f --prefix="$mandir"/
6538d1ef
EW
25
26if test -n "$GZ"; then
87027ae4
JH
27 git ls-tree -r --name-only $head |
28 xargs printf "$mandir/%s\n" |
29 xargs gzip -f
6538d1ef
EW
30fi
31rm -f "$GIT_INDEX_FILE"