Re: [PATCH 0/7] Enhance TkCVS interoperability
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 25, 2008, 01:08 UTC
- Message-ID
- <7vd4pjr4o1.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <cover.1206393086.git.dash@foobox.net>
Damien Diederen <dash@foobox.net> writes:
Show 7 quoted lines
> This series was developed to improve interoperability between > git-cvsserver and TkCVS, a CVS client that is fairly popular at least > in some corporate environments. > > Patches 1-6 are "obvious" improvements, implementing missing features > or fixing incorrect behaviour. 7 is more questionable, but likely to > result in more intelligible log output in a majority of cases.
If anything, I think 7/7 is an improvement that consolidates a few duplicated code that massage authorship information in the commit object into CVS form. I cannot readily tell what is going on from this old code sequence:
- $metadata->{$commithash}{author} =~ s/\s+.*//;
- $metadata->{$commithash}{author} =~ s/^(.{8}).*/$1/;but I can tell what is going on in the latter even without the help from the leading comment.
+# 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/;
+
+ $author;
+}And 1/7-6/7 looked all good, but this is just from _looking_. I do not run cvsserver myself, so people should take this with a moderate amount of salt.
Martin, Frank?