Edit page blog/2009/06
[wiki.git] / post_edit_hook.sh
1 #!/bin/sh
2
3 # Die easily and make sure the cgi collects stderr too
4 set -e
5 exec 2>&1
6
7 if [ $# -ne 3 ]; then
8         echo "Usage $0 <path-to-commit> <remote-user> <remote-host>"
9         exit 1
10 fi
11
12 repo=`dirname "$1"`
13 file=`basename "$1"`
14
15 cd $repo
16 git-add $file # In case it's a new page
17
18 GIT_COMMITTER_NAME='Piki Plus' \
19 GIT_COMMITTER_EMAIL='webmaster@codewiz.org' \
20 git-commit -a -m "Edit page $file" --author="$2 <$2@$3>"