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

[PATCH 2/1] git svn: remove extraneous newline from log output

From
EWEric Wong <normalperson@yhbt.net>
Date
Jul 25, 2010, 08:13 UTC
Message-ID
<20100725081344.GB22373@dcvr.yhbt.net>
In-Reply-To
<20100725081057.GA22373@dcvr.yhbt.net>

This is to match the output of "svn log", which does not add an extra newline before the next log entry.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---

The following are pushed to the master git svn repo at git://git.bogomips.org/git-svn Let me know if everything looks alright and I'll ask Junio to pull.

	Eric Wong (1):
	      git svn: remove extraneous newline from log output
	Jens Seidel (1):
	      git-svn: tweak log format to match "svn log" output
 git-svn.perl           |    3 +++
 t/t9116-git-svn-log.sh |    4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 5252722..f9b7711 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -5743,6 +5743,9 @@ sub cmd_show_log {
 			push @{$c->{stat}}, $_;
 			$stat = undef;
 		} elsif (/^${esc_color}    (git-svn-id:.+)$/o) {
+			if (@{$c->{l}} && $c->{l}->[-1] eq "\n") {
+				pop @{$c->{l}};
+			}
 			($c->{url}, $c->{r}, undef) = ::extract_metadata($1);
 		} elsif (s/^${esc_color}    //o) {
 			push @{$c->{l}}, $_;
diff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh
index 4394fb2..586f64b 100755
--- a/t/t9116-git-svn-log.sh
+++ b/t/t9116-git-svn-log.sh
@@ -49,7 +49,7 @@ test_expect_success 'setup repository and import' '
 	fi
 	'
 
-test_expect_failure 'log matches svn log' '
+test_expect_success 'log matches svn log' '
 	git reset --hard a &&
 	(
 		cd checkout &&
@@ -59,7 +59,7 @@ test_expect_failure 'log matches svn log' '
 	test_cmp expected actual
 	'
 
-test_expect_failure NONCLOCALE 'log matches svn log, original locale' '
+test_expect_success NONCLOCALE 'log matches svn log, original locale' '
 	(
 		LC_ALL=$ORIGINAL_LANG &&
 		(
-- 
Eric Wong
Previous: Eric WongNext: Jens Seidel
Message 3 of 9 in “git-svn: tweak log format to match "svn log" output”
  1. git-svn: tweak log format to match "svn log" outputJonathan Nieder, Jul 25, 2010
  2. Eric WongJul 25, 2010
  3. 2/1 git svn: remove extraneous newline from log outputEric Wong, Jul 25, 2010
  4. Jens SeidelJul 25, 2010
  5. Eric WongJul 26, 2010
  6. Jonathan NiederJul 25, 2010
  7. Eric WongJul 25, 2010
  8. Jens SeidelJul 25, 2010
  9. Jens SeidelJul 25, 2010

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.