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

1 messages from 2008-04-13 to 2008-04-13. Participants: Fredrik Noring.
Thread: https://gitlist.dev/t/13088

## Fredrik Noring, 2008-04-13 10:54

Subject: [PATCH] cvsserver: Removing leading and trailing newlines for "cvs log"
Message-ID: <CC1E4EF8-9A0A-4463-8704-18849457DC69@nocrew.org>
URL: https://gitlist.dev/e/CC1E4EF8-9A0A-4463-8704-18849457DC69%40nocrew.org

```
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



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;
 }




```
