@matheusbsbs / matheus-bagliano / commits / 280514e1df
Fork 0

cvsserver: add option to configure commit message

cvsserver annotates each commit message by "via git-CVS emulator". This is made configurable via gitcvs.commitmsgannotation. Signed-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de> Signed-off-by: Lars Noschinski <lars@public.noschinski.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fabian Emmes committed Jan 2, 2009 at 16:40 UTC 280514e1dff3284549175cb0e8edb9b796e8891e
2 files changed +11 -1
Documentation/config.txt
+4
@@ -723,6 +723,10 @@ gc.rerereunresolved::
723 kept for this many days when 'git-rerere gc' is run.
724 The default is 15 days. See linkgit:git-rerere[1].
725
726 +gitcvs.commitmsgannotation::
727 + Append this string to each commit message. Set to empty string
728 + to disable this feature. Defaults to "via git-CVS emulator".
729 +
730 gitcvs.enabled::
731 Whether the CVS server interface is enabled for this repository.
732 See linkgit:git-cvsserver[1].
git-cvsserver.perl
+7 -1
@@ -1358,7 +1358,13 @@ sub req_ci
1358 # write our commit message out if we have one ...
1359 my ( $msg_fh, $msg_filename ) = tempfile( DIR => $TEMP_DIR );
1360 print $msg_fh $state->{opt}{m};# if ( exists ( $state->{opt}{m} ) );
1361 - print $msg_fh "\n\nvia git-CVS emulator\n";
1361 + if ( defined ( $cfg->{gitcvs}{commitmsgannotation} ) ) {
1362 + if ($cfg->{gitcvs}{commitmsgannotation} !~ /^\s*$/ ) {
1363 + print $msg_fh "\n\n".$cfg->{gitcvs}{commitmsgannotation}."\n"
1364 + }
1365 + } else {
1366 + print $msg_fh "\n\nvia git-CVS emulator\n";
1367 + }
1368 close $msg_fh;
1369
1370 my $commithash = `git-commit-tree $treehash -p $parenthash < $msg_filename`;