Be verbose when !initial commit
authorYasushi SHOJI <yashi@atmark-techno.com>
Mon, 20 Mar 2006 13:11:12 +0000 (22:11 +0900)
committerJunio C Hamano <junkio@cox.net>
Mon, 20 Mar 2006 22:37:59 +0000 (14:37 -0800)
verbose option in git-commit.sh lead us to run git-diff-index, which
needs a commit-ish we are making diff against. When we are commiting
the fist set, we obviously don't have any commit-ish in the repo. So
we just skip the git-diff-index run.

It might be possible to produce diff against empty but do we need
that?

Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-commit.sh
index 330a434b1891a67f78dfbb665558efef868bb704..1e7c09e1f2fdf3b4327c903084bd86616b7956f1 100755 (executable)
@@ -161,7 +161,7 @@ run_status () {
            }
        '
 
-       if test -n "$verbose"
+       if test -n "$verbose" -a -z "$IS_INITIAL"
        then
            git-diff-index --cached -M -p --diff-filter=MDTCRA $REFERENCE
        fi