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