3 # Copyright (c) 2005 Linus Torvalds
7 echo 'citool-commit [<path>...] < commit-message'
12 if [ ! -d "$GIT_DIR" ]; then
13 echo Not a git directory
1>&2
17 git-update-cache
-q --refresh -- "$@" ||
exit 1
19 if [ ! -r "$GIT_DIR/HEAD" ]; then
20 if [ -z "$(git-ls-files)" ]; then
21 echo Nothing to commit
1>&2
26 if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
28 echo "# It looks like your may be committing a MERGE."
29 echo "# If this is not correct, please remove the file"
30 echo "# $GIT_DIR/MERGE_HEAD"
31 echo "# and try again"
33 PARENTS
="-p HEAD -p MERGE_HEAD"
35 git-status-script
>>.editmsg
44 grep -v '^#' < .editmsg | git-stripspace
> .cmitmsg
46 tree
=$
(git-write-tree
) &&
47 commit
=$
(cat .cmitmsg | git-commit-tree
$tree $PARENTS) &&
48 echo $commit > "$GIT_DIR/HEAD" &&
49 rm -f -- "$GIT_DIR/MERGE_HEAD"
51 rm -f .cmitmsg .editmsg