Thread (49 messages) flat view 49 messages, 7 authors, 2016-06-15
DORMANTno replies

[PATCH] cvsimport: Limit the log string to 32k

From: Matthias Urlichs <hidden>
Date: 2016-06-15 22:42:01
Subsystem: the rest · Maintainer: Linus Torvalds

Teach the new cvsimport script to chop the log string's trailing whitespace.

Limit the log string to 32k, in order to be compatible with the old
cvs2git program.

Signed-Off-By: Matthias Urlichs <redacted>

---
diff --git a/git-cvsimport-script b/git-cvsimport-script
--- a/git-cvsimport-script
+++ b/git-cvsimport-script
@@ -468,7 +468,12 @@ my $commit = sub {
 	}
 	$pw->writer();
 	$pr->reader();
-	print $pw $logmsg
+
+	# compatibility with git2cvs
+	substr($logmsg,32767) = "" if length($logmsg) > 32767;
+	$logmsg =~ s/[\s\n]+\z//;
+
+	print $pw "$logmsg\n"
 		or die "Error writing to git-commit-tree: $!\n";
 	$pw->close();
 

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help