From: Frank Lichtenheld Date: Tue, 25 Mar 2008 09:26:21 GMT Subject: Re: [PATCH 7/7] cvsserver: Use the user part of the email in log and annotate results Message-ID: <20080325092621.GN25732@mail-vs.djpig.de> In-Reply-To: <01e5947cde524f4eb97a86785d0e1f28e2d040e0.1206393086.git.dash@foobox.net> On Mon, Mar 24, 2008 at 11:50:55PM +0100, Damien Diederen wrote: > +# Generate a CVS author name from Git author information, by taking > +# the first eight characters of the user part of the email address. > +sub cvs_author > +{ > + my $author = shift; > + > + $author =~ s/.*<([^>]+)\@[^>]+>$/$1/; > + $author =~ s/^(.{8}).*/$1/; IMHO substr($author, 0, 8) would be easier to read here. (It is also much faster according to some quick benchmarks I just ran) Gruesse, -- Frank Lichtenheld www: http://www.djpig.de/