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

[PATCH 2/2] git-svn: test that extra blank lines aren't inserted in commit messages.

From
Avery Pennarun <apenwarr@gmail.com>
Date
Jun 12, 2008, 23:10 UTC
Message-ID
<1213312251-8081-2-git-send-email-apenwarr@gmail.com>
In-Reply-To
<1213312251-8081-1-git-send-email-apenwarr@gmail.com>

Improve the git-svn-author test to check that extra newlines aren't inserted into commit messages as they take a round trip from git to svn and back.

We test both with and without the --add-author-from option to git-svn.
git-svn: test that svn repo doesn't have extra newlines.
Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
---
 t/t9122-git-svn-author.sh |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/t/t9122-git-svn-author.sh b/t/t9122-git-svn-author.sh
index 8c58f0b..1190576 100755
--- a/t/t9122-git-svn-author.sh
+++ b/t/t9122-git-svn-author.sh
@@ -64,7 +64,21 @@ test_expect_success 'interact with it via git-svn' '
 
 	# Make sure --add-author-from with --use-log-author affected
 	# the authorship information
-	grep "^Author: A U Thor " actual.4
+	grep "^Author: A U Thor " actual.4 &&
+
+	# Make sure there are no commit messages with excess blank lines
+	test $(grep "^ " actual.2 | wc -l) = 3 &&
+	test $(grep "^ " actual.3 | wc -l) = 5 &&
+	test $(grep "^ " actual.4 | wc -l) = 5 &&
+
+	# Make sure there are no svn commit messages with excess blank lines
+	(
+		cd work.svn &&
+		svn up &&
+		
+		test $(svn log -r2:2 | wc -l) = 5 &&
+		test $(svn log -r4:4 | wc -l) = 7
+	)
 '
 
 test_done
-- 
1.5.4.3
Previous: Avery PennarunNext: Junio C Hamano
Message 2 of 9 in “git-svn: don't append extra newlines at the end of commit messages.”
  1. 1/2 git-svn: don't append extra newlines at the end of commit messages.Avery Pennarun, Jun 12, 2008
  2. 2/2 git-svn: test that extra blank lines aren't inserted in commit messages.Avery Pennarun, Jun 12, 2008
  3. Junio C HamanoJun 13, 2008
  4. Karl HasselströmJun 13, 2008
  5. Avery PennarunJun 13, 2008
  6. Andreas EricssonJun 13, 2008
  7. Karl HasselströmJun 13, 2008
  8. Karl HasselströmJun 14, 2008
  9. Avery PennarunJun 13, 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.