1 #!/bin/sh
2 git-status-script > .editmsg
3 if [ "$?" != "0" ]
4 then
5 cat .editmsg
6 exit 1
7 fi
8 ${VISUAL:-${EDITOR:-vi}} .editmsg
9 grep -v '^#' < .editmsg | git-stripspace > .cmitmsg
10 [ -s .cmitmsg ] || exit 1
11 tree=$(git-write-tree) || exit 1
12 commit=$(cat .cmitmsg | git-commit-tree $tree -p HEAD) || exit 1
13 echo $commit > ${GIT_DIR:-.git}/HEAD