Re: [PATCH] cvsserver: change generation of CVS author names
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 3, 2009, 22:14 UTC
- Message-ID
- <7vwsdc3ulg.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1230910814-32307-2-git-send-email-fabian.emmes@rwth-aachen.de>
Fabian Emmes <fabian.emmes@rwth-aachen.de> writes:
Show 7 quoted lines
> 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>
Stating "we should have done this from day one" is one thing (even though "because some standard says so" is not particularly a good justification without "and matches the way people use CVS in the real world in practice" appended to it).
"We should suddenly change the behaviour" is quite a different thing and it depends on what follows that sentence if the change is justifiable. We do not want to hear "...; screw the existing repositories if they have nonconforming names.". It is Ok if it is "...; existing repositories will be affected, but the damage is limited to very minor set of operations, namely X, Y and Z".
In other words, is there any backward compatibility issue when a repository that has served existing CVS users and checkouts with older version switches to the patched one? If there is one, is that grave enough that we should care?
Show 29 quoted lines
> 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;
> }