From: Fabian Emmes <fabian.emmes@rwth-aachen.de>
To: git@vger.kernel.org
Cc: gitster@pobox.com, Fabian Emmes <fabian.emmes@rwth-aachen.de>,
Lars Noschinski <lars@public.noschinski.de>
Subject: [PATCH] cvsserver: change generation of CVS author names
Date: Fri, 02 Jan 2009 16:40:14 +0100 [thread overview]
Message-ID: <1230910814-32307-2-git-send-email-fabian.emmes@rwth-aachen.de> (raw)
In-Reply-To: <1230910814-32307-1-git-send-email-fabian.emmes@rwth-aachen.de>
CVS username is generated from local part email address.
We take the whole local part but restrict the character set to the
Portable Filename Character Set, which is used for Unix login names
according to Single Unix Specification v3.
Signed-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de>
Signed-off-by: Lars Noschinski <lars@public.noschinski.de>
---
git-cvsserver.perl | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index cbcaeb4..fef7faf 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -2533,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;
}
--
1.5.6.3
next prev parent reply other threads:[~2009-01-02 15:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-02 15:40 [PATCH] cvsserver: add option to configure commit message Fabian Emmes
2009-01-02 15:40 ` Fabian Emmes [this message]
2009-01-03 22:14 ` [PATCH] cvsserver: change generation of CVS author names Junio C Hamano
2009-01-04 11:13 ` Lars Noschinski
2009-01-06 8:18 ` Junio C Hamano
2009-01-04 10:01 ` [PATCH] cvsserver: add option to configure commit message Junio C Hamano
2009-01-04 11:23 ` Lars Noschinski
2009-01-04 19:20 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1230910814-32307-2-git-send-email-fabian.emmes@rwth-aachen.de \
--to=fabian.emmes@rwth-aachen.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=lars@public.noschinski.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).