2006-12-23 19:26:09 +03:00
|
|
|
#!/bin/sh
|
|
|
|
# This requires a branch named in $head
|
|
|
|
# (usually 'man' or 'html', provided by the git.git repository)
|
|
|
|
set -e
|
|
|
|
head="$1"
|
|
|
|
mandir="$2"
|
|
|
|
SUBDIRECTORY_OK=t
|
|
|
|
USAGE='<refname> <target directory>'
|
2008-07-08 06:37:38 +04:00
|
|
|
. "$(git --exec-path)"/git-sh-setup
|
2007-08-05 10:48:27 +04:00
|
|
|
cd_to_toplevel
|
2006-12-23 19:26:09 +03:00
|
|
|
|
|
|
|
test -z "$mandir" && usage
|
2007-07-03 09:52:14 +04:00
|
|
|
if ! git rev-parse --verify "$head^0" >/dev/null; then
|
2006-12-23 19:26:09 +03:00
|
|
|
echo >&2 "head: $head does not exist in the current repository"
|
|
|
|
usage
|
|
|
|
fi
|
|
|
|
|
|
|
|
GIT_INDEX_FILE=`pwd`/.quick-doc.index
|
|
|
|
export GIT_INDEX_FILE
|
|
|
|
rm -f "$GIT_INDEX_FILE"
|
2007-08-05 10:48:27 +04:00
|
|
|
trap 'rm -f "$GIT_INDEX_FILE"' 0
|
|
|
|
|
2007-07-03 09:52:14 +04:00
|
|
|
git read-tree $head
|
|
|
|
git checkout-index -a -f --prefix="$mandir"/
|
2006-12-23 19:26:09 +03:00
|
|
|
|
|
|
|
if test -n "$GZ"; then
|
2007-08-07 08:15:15 +04:00
|
|
|
git ls-tree -r --name-only $head |
|
|
|
|
xargs printf "$mandir/%s\n" |
|
|
|
|
xargs gzip -f
|
2006-12-23 19:26:09 +03:00
|
|
|
fi
|
|
|
|
rm -f "$GIT_INDEX_FILE"
|