git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Be verbose when !initial commit

From
Yasushi SHOJI <yashi@atmark-techno.com>
Date
Mar 20, 2006, 13:11 UTC
Message-ID
<87y7z58dn3.wl@mail2.atmark-techno.com>

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>
---
 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
Message 1 of 1 in “Be verbose when !initial commit”
  1. Be verbose when !initial commitYasushi SHOJI, Mar 20, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.