From ebd124c6783da5e064963611ee17741cd173f6b5 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Thu, 14 Dec 2006 23:15:44 -0500 Subject: 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 Signed-off-by: Junio C Hamano --- git-commit.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'git-commit.sh') diff --git a/git-commit.sh b/git-commit.sh index 05828bb11..a30bda19d 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" -- cgit v1.2.1