2006-12-23 16:26:09 +00: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 02:37:38 +00:00
|
|
|
. "$(git --exec-path)"/git-sh-setup
|
2007-08-05 06:48:27 +00:00
|
|
|
cd_to_toplevel
|
2006-12-23 16:26:09 +00:00
|
|
|
|
|
|
|
test -z "$mandir" && usage
|
2007-07-03 05:52:14 +00:00
|
|
|
if ! git rev-parse --verify "$head^0" >/dev/null; then
|
2006-12-23 16:26:09 +00: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 06:48:27 +00:00
|
|
|
trap 'rm -f "$GIT_INDEX_FILE"' 0
|
|
|
|
|
2007-07-03 05:52:14 +00:00
|
|
|
git read-tree $head
|
|
|
|
git checkout-index -a -f --prefix="$mandir"/
|
2006-12-23 16:26:09 +00:00
|
|
|
|
|
|
|
if test -n "$GZ"; then
|
2007-08-07 04:15:15 +00:00
|
|
|
git ls-tree -r --name-only $head |
|
|
|
|
xargs printf "$mandir/%s\n" |
|
|
|
|
xargs gzip -f
|
2006-12-23 16:26:09 +00:00
|
|
|
fi
|
|
|
|
rm -f "$GIT_INDEX_FILE"
|