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

git commit --interactive creates empty commits

From
JSJörg Sommer <joerg@alea.gnuu.de>
Date
Apr 14, 2008, 00:35 UTC
Message-ID
<slrng059n3.nd8.joerg@alea.gnuu.de>
Hi,
is it expected that this test fails?
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index c0288f3..2c21428 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -123,6 +123,18 @@ test_expect_success \
 	"interactive add" \
 	"echo 7 | git-commit --interactive | grep 'What now'"
 
+cat >editor <<\EOF
+#!/bin/sh
+echo invalid commit > $1
+EOF
+chmod 755 editor
+
+test_expect_success \
+	"interactive fails on empty index" \
+	"export VISUAL=./editor && 
+	test_must_fail git commit --interactive < /dev/null &&
+	unset VISUAL"
+
 test_expect_success \
 	"showing committed revisions" \
 	"git-rev-list HEAD >current"

Bye, Jörg.
-- 
Damit das Mögliche entsteht, muß immer wieder das Unmögliche versucht
werden.                                       (Hermann Hesse)
Next: Junio C Hamano
Message 1 of 2 in “git commit --interactive creates empty commits”
  1. Jörg SommerApr 14, 2008
  2. Junio C HamanoApr 14, 2008

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.