diff options
author | Junio C Hamano <junkio@cox.net> | 2006-12-27 02:43:46 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-12-27 02:43:46 -0800 |
commit | 37818d7db070f67a20df58ac7d5e04cc63ef1867 (patch) | |
tree | 1b1b2b71afab1c4ad29666f56fa8d2560b7855c6 /git-commit.sh | |
parent | 4bcb310c2539b66d535e87508d1b7a90fe29c083 (diff) | |
parent | ae72f685418b79bbd67e1017c5b1ac7d731c042e (diff) | |
download | git-37818d7db070f67a20df58ac7d5e04cc63ef1867.tar.gz |
Merge branch 'master' into js/shallow
This is to adjust to:
count-objects -v: show number of packs as well.
which will break a test in this series.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-commit.sh')
-rwxr-xr-x | git-commit.sh | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/git-commit.sh b/git-commit.sh index 81c3a0cb61..6bce41af4d 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 @@ -350,19 +355,9 @@ t,) refuse_partial "Cannot do a partial commit during a merge." fi TMP_INDEX="$GIT_DIR/tmp-index$$" - if test -z "$initial_commit" - then - # make sure index is clean at the specified paths, or - # they are additions. - dirty_in_index=`git-diff-index --cached --name-status \ - --diff-filter=DMTU HEAD -- "$@"` - test -z "$dirty_in_index" || - refuse_partial "Different in index and the last commit: -$dirty_in_index" - fi commit_only=`git-ls-files --error-unmatch -- "$@"` || exit - # Build the temporary index and update the real index + # Build a temporary index and update the real index # the same way. if test -z "$initial_commit" then @@ -525,7 +520,7 @@ then current="$(git-rev-parse --verify HEAD)" else if [ -z "$(git-ls-files)" ]; then - echo >&2 Nothing to commit + echo >&2 'nothing to commit (use "git add file1 file2" to include for commit)' exit 1 fi PARENTS="" @@ -625,8 +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 + exit "$ret" |