[PATCH] Be verbose when !initial commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxx>


---

 git-commit.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

e071afdc1c6e9ce6bbee14aa0652e7bb7043550c
diff --git a/git-commit.sh b/git-commit.sh
index 330a434..1e7c09e 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -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
-- 
1.2.4

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]