1#!/bin/sh2git-status-script > .editmsg3if [ "$?" != "0" ]4then5cat .editmsg6exit 17fi8ED=${VISUAL:$EDITOR}9ED=${ED:vi}10$ED .editmsg11grep -v '^#' < .editmsg | git-stripspace > .cmitmsg12[ -s .cmitmsg ] || exit 113tree=$(git-write-tree) || exit 114commit=$(cat .cmitmsg | git-commit-tree $tree -p HEAD) || exit 115echo $commit > .git/HEAD