#!/bin/sh
#
# This script is called from the post-update hook, and when
-# the master branch is updated, run in $HOME/doc-git, like
+# the master branch is updated, run in $HOME/git-doc, like
# this:
: <<\END_OF_COMMENTARY
END_OF_COMMENTARY
-# $HOME/doc-git is a clone of the git.git repository and
+# $HOME/git-doc is a clone of the git.git repository and
# has the master branch checkd out. We update the working
# tree and build pre-formatted documentation pages, install
# in doc-htmlpages and doc-manapges subdirectory here.
cd "$DOCREPO" || exit $?
git pull "$MASTERREPO" master &&
-test $(git-rev-parse --verify refs/heads/master) == "$ID" || exit $?
+test $(git-rev-parse --verify refs/heads/master) == "$ID" &&
+NID=$(git-describe --abbrev=4 "$ID") &&
+test '' != "$NID" || exit $?
# Set up subrepositories
test -d doc-htmlpages || (
cd doc-htmlpages &&
git init-db || exit $?
- if ID=$(git fetch-pack "$MASTERREPO" html)
+ if SID=$(git fetch-pack "$MASTERREPO" html)
then
- git update-ref HEAD `expr "$ID" : '\(.*\) .*'` &&
+ git update-ref HEAD `expr "$SID" : '\(.*\) .*'` &&
git checkout || exit $?
fi
)
cd doc-manpages &&
git init-db || exit $?
- if ID=$(git fetch-pack "$MASTERREPO" man)
+ if SID=$(git fetch-pack "$MASTERREPO" man)
then
- git update-ref HEAD `expr "$ID" : '\(.*\) .*'` &&
+ git update-ref HEAD `expr "$SID" : '\(.*\) .*'` &&
git checkout || exit $?
fi
)
cd ../doc-htmlpages &&
git add . &&
- if git commit -a -m "Autogenerated HTML docs for $ID"
+ if git commit -a -m "Autogenerated HTML docs for $NID"
then
git-send-pack "$MASTERREPO" master:refs/heads/html || {
echo "* HTML failure"
cd ../doc-manpages &&
git add . &&
- if git commit -a -m "Autogenerated man pages for $ID"
+ if git commit -a -m "Autogenerated man pages for $NID"
then
git-send-pack "$MASTERREPO" master:refs/heads/man || {
echo "* man failure"