git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] cvsserver: change generation of CVS author names

From
FEFabian Emmes <fabian.emmes@rwth-aachen.de>
Date
Jan 2, 2009, 15:40 UTC
Message-ID
<1230910814-32307-2-git-send-email-fabian.emmes@rwth-aachen.de>
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
Previous: Fabian EmmesNext: Junio C Hamano
Message 2 of 8 in “cvsserver: add option to configure commit message”
  1. cvsserver: add option to configure commit messageFabian Emmes, Jan 2, 2009
  2. cvsserver: change generation of CVS author namesFabian Emmes, Jan 2, 2009
  3. Junio C HamanoJan 3, 2009
  4. Lars NoschinskiJan 4, 2009
  5. Junio C HamanoJan 6, 2009
  6. Junio C HamanoJan 4, 2009
  7. Lars NoschinskiJan 4, 2009
  8. Junio C HamanoJan 4, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.