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