1#!/bin/sh2git-status-script > .editmsg3if [ "$?" != "0" ]4then5cat .editmsg6exit 17fi8${VISUAL:-${EDITOR:-vi}} .editmsg9grep -v '^#' < .editmsg | git-stripspace > .cmitmsg10[ -s .cmitmsg ] || exit 111tree=$(git-write-tree) || exit 112commit=$(cat .cmitmsg | git-commit-tree $tree -p HEAD) || exit 113echo $commit > ${GIT_DIR:-.git}/HEAD