aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-13 23:09:35 -0800
committerJunio C Hamano <gitster@pobox.com>2009-01-13 23:09:35 -0800
commitd83fd33bc14512afdd0d5b8e1d0fe46311531e2e (patch)
tree9d794fe409e96a52135611413caf6a972c100269
parent49129d3731a6d74ad403ecdffc0e7940a597bc65 (diff)
parentd500a1ee8fe4424beb7a98e4fa6159677e7569d0 (diff)
downloadgit-d83fd33bc14512afdd0d5b8e1d0fe46311531e2e.tar.gz
git-d83fd33bc14512afdd0d5b8e1d0fe46311531e2e.tar.xz
Merge branch 'fe/cvsserver'
* fe/cvsserver: cvsserver: change generation of CVS author names cvsserver: add option to configure commit message
-rw-r--r--Documentation/config.txt4
-rwxr-xr-xgit-cvsserver.perl20
2 files changed, 20 insertions, 4 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt
index ea0cd97b0..6b3ac5aa9 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -725,6 +725,10 @@ gc.rerereunresolved::
kept for this many days when 'git-rerere gc' is run.
The default is 15 days. See linkgit:git-rerere[1].
+gitcvs.commitmsgannotation::
+ Append this string to each commit message. Set to empty string
+ to disable this feature. Defaults to "via git-CVS emulator".
+
gitcvs.enabled::
Whether the CVS server interface is enabled for this repository.
See linkgit:git-cvsserver[1].
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index b0a805c68..fef7faf33 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -1358,7 +1358,13 @@ sub req_ci
# write our commit message out if we have one ...
my ( $msg_fh, $msg_filename ) = tempfile( DIR => $TEMP_DIR );
print $msg_fh $state->{opt}{m};# if ( exists ( $state->{opt}{m} ) );
- print $msg_fh "\n\nvia git-CVS emulator\n";
+ if ( defined ( $cfg->{gitcvs}{commitmsgannotation} ) ) {
+ if ($cfg->{gitcvs}{commitmsgannotation} !~ /^\s*$/ ) {
+ print $msg_fh "\n\n".$cfg->{gitcvs}{commitmsgannotation}."\n"
+ }
+ } else {
+ print $msg_fh "\n\nvia git-CVS emulator\n";
+ }
close $msg_fh;
my $commithash = `git-commit-tree $treehash -p $parenthash < $msg_filename`;
@@ -2527,12 +2533,18 @@ sub open_blob_or_die
return $fh;
}
-# Generate a CVS author name from Git author information, by taking
-# the first eight characters of the user part of the email address.
+# Generate a CVS author name from Git author information, by taking the local
+# part of the email address and replacing characters not in the Portable
+# Filename Character Set (see IEEE Std 1003.1-2001, 3.276) by underscores. CVS
+# Login names are Unix login names, which should be restricted to this
+# character set.
sub cvs_author
{
my $author_line = shift;
- (my $author) = $author_line =~ /<([^>@]{1,8})/;
+ (my $author) = $author_line =~ /<([^@>]*)/;
+
+ $author =~ s/[^-a-zA-Z0-9_.]/_/g;
+ $author =~ s/^-/_/;
$author;
}