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

[PATCH/RFC] t3404: test autosquash for fixup! commits with funny messages

From
USUwe Storbeck <uwe@ibr.ch>
Date
Mar 14, 2014, 23:58 UTC
Message-ID
<20140314235811.GA4213@ibr.ch>

This commit adds a test to verify the correct behavior when rebase -i is used to autosquash fixup! commits where the commit message contains a backslash sequence (\n).

When echo is used instead of printf to handle such a commit message the test will fail on shells (e.g. dash) where the echo command interprets backslash sequences as control characters.

Signed-off-by: Uwe Storbeck <uwe@ibr.ch>
---
 t/t3404-rebase-interactive.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 50e22b1..6d32661 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -798,6 +798,18 @@ test_expect_success 'rebase-i history with funny messages' '
 	test_cmp expect actual
 '
 
+test_expect_success 'autosquash fixup! commits with funny messages' '
+	test_when_finished "git rebase --abort || :" &&
+	echo >>file1 &&
+	git commit -a -m "something that looks like a newline (\n)" &&
+	echo >>file1 &&
+	git commit -a --fixup HEAD &&
+	set_fake_editor &&
+	FAKE_LINES="" &&
+	export FAKE_LINES &&
+	git rebase -i --autosquash HEAD~2
+'
+
 
 test_expect_success 'prepare for rebase -i --exec' '
 	git checkout master &&
-- 
1.9.0
Message 1 of 1 in “t3404: test autosquash for fixup! commits with funny messages”
  1. t3404: test autosquash for fixup! commits with funny messagesUwe Storbeck, Mar 14, 2014

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.