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

[PATCH] Add test for rebase -i with commits that do not pass pre-commit

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 28, 2008, 16:33 UTC
Message-ID
<alpine.LSU.1.00.0801281632300.23907@racer.site>
In-Reply-To
<20080128154232.900.qmail@c07ab49f5b12dd.315fe32.mid.smarden.org>

This accompanies c5b09feb(Avoid update hook during git-rebase --interactive) to prove that Debian's Bug#458782 (git-core: git-rebase doesn't work when trying to squash changes into commits created with --no-verify) is indeed fixed now.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
	On Mon, 28 Jan 2008, Gerrit Pape wrote:
	> Hi, IIRC I managed to reproduce the problem below, but currently 
	> don't have the time to track it down.  Hopefully someone else 
	> can work on it, there's even a patch suggested.
	It is even in 1.5.4-rc1.
 t/t3404-rebase-interactive.sh |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 74a7eb3..e33ea4e 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -324,4 +324,20 @@ test_expect_success 'rebase a detached HEAD' '
 	test $grandparent = $(git rev-parse HEAD~2)
 '
 
+test_expect_success 'rebase a commit violating pre-commit' '
+
+	mkdir -p .git/hooks &&
+	PRE_COMMIT=.git/hooks/pre-commit &&
+	echo "#!/bin/sh" > $PRE_COMMIT &&
+	echo "test -z \"\$(git diff --cached --check)\"" >> $PRE_COMMIT &&
+	chmod a+x $PRE_COMMIT &&
+	echo "monde! " >> file1 &&
+	test_tick &&
+	! git commit -m doesnt-verify file1 &&
+	git commit -m doesnt-verify --no-verify file1 &&
+	test_tick &&
+	FAKE_LINES=2 git rebase -i HEAD~2
+
+'
+
 test_done
-- 
1.5.4.rc5.15.g8231f
Previous: Gerrit PapeNext: Shawn O. Pearce
Message 2 of 3 in “git-rebase doesn't work when trying to squash changes into commits created with --no-verify”
  1. Gerrit PapeJan 28, 2008
  2. Add test for rebase -i with commits that do not pass pre-commitJohannes Schindelin, Jan 28, 2008
  3. Shawn O. PearceJan 29, 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.