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
|
|
|
|
export GIT_DIR
|
|
|
|
|
|
|
|
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-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
|
|
|
|
cd "$mandir"
|
2007-07-03 07:52:14 +02:00
|
|
|
for i in `git ls-tree -r --name-only $head`
|
2006-12-23 17:26:09 +01:00
|
|
|
do
|
|
|
|
gzip < $i > $i.gz && rm $i
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
rm -f "$GIT_INDEX_FILE"
|