summaryrefslogtreecommitdiff
path: root/git-commit.sh
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2006-12-14 23:15:44 -0500
committerJunio C Hamano <junkio@cox.net>2006-12-15 22:29:54 -0800
commitebd124c6783da5e064963611ee17741cd173f6b5 (patch)
treed3e5ba5b8a6ef190bc1144c841105a2de24425c9 /git-commit.sh
parent1510fea781cb0517eeba8c378964f7bc4f9577ab (diff)
downloadgit-ebd124c6783da5e064963611ee17741cd173f6b5.tar.gz
make commit message a little more consistent and conforting
It is nicer to let the user know when a commit succeeded all the time, not only the first time. Also the commit sha1 is much more useful than the tree sha1 in this case. This patch also introduces a -q switch to supress this message as well as the summary of created/deleted files. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-commit.sh')
-rwxr-xr-xgit-commit.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/git-commit.sh b/git-commit.sh
index 05828bb113..a30bda19d5 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -80,6 +80,7 @@ no_edit=
log_given=
log_message=
verify=t
+quiet=
verbose=
signoff=
force_author=
@@ -241,6 +242,10 @@ $1"
signoff=t
shift
;;
+ -q|--q|--qu|--qui|--quie|--quiet)
+ quiet=t
+ shift
+ ;;
-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
verbose=t
shift
@@ -615,11 +620,17 @@ then
git-rerere
fi
-if test -x "$GIT_DIR"/hooks/post-commit && test "$ret" = 0
+if test "$ret" = 0
then
- "$GIT_DIR"/hooks/post-commit
+ if test -x "$GIT_DIR"/hooks/post-commit
+ then
+ "$GIT_DIR"/hooks/post-commit
+ fi
+ if test -z "$quiet"
+ then
+ echo "Created${initial_commit:+ initial} commit $commit"
+ git-diff-tree --shortstat --summary --root --no-commit-id HEAD
+ fi
fi
-test "$ret" = 0 && git-diff-tree --summary --root --no-commit-id HEAD
-
exit "$ret"