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