threads / patch / 13088

patchcvsserver: Removing leading and trailing newlines for "cvs log"

Subject: [PATCH] cvsserver: Removing leading and trailing newlines for "cvs log"

## tl;dr

One message between Apr 13, 2008 and Apr 13, 2008. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Fredrik Noring· Apr 13, 2008, 10:54 UTC · lore
Hi all,

Attached patch removes the leading and trailing newlines that the cvsserver command adds to commit messages for "cvs log".

  git-cvsserver.perl |    4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

Another note: For every commit, cvsserver claims lines changed are "+2 -3" as hard-coded values no matter what, but that's a fix for another day. ;)

Thanks, Fredrik

Show changes to git-cvsserver.perl +3 −1
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 59a1609..1927c1c 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -3049,7 +3049,9 @@ sub commitmessage
 
     my @lines = safe_pipe_capture("git-cat-file", "commit", $commithash);
     shift @lines while ( $lines[0] =~ /\S/ );
-    $message = join("",@lines);
+    shift @lines;
+    map(s/\n$//s, @lines);
+    $message = join("\n", @lines);
     $message .= " " if ( $message =~ /\n$/ );
     return $message;
 }

← back to recent threads