[PATCH] cvsserver: Removing leading and trailing newlines for "cvs log"
- From
- Fredrik Noring <noring@nocrew.org>
- Date
- Apr 13, 2008, 10:54 UTC
- Message-ID
- <CC1E4EF8-9A0A-4463-8704-18849457DC69@nocrew.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; }