{"thread":{"id":"16964","subject":"[PATCH] cvsserver: change generation of CVS author names","startedAt":"2009-01-02T15:40:13Z","lastAt":"2009-01-06T08:18:21Z","messageCount":8,"participants":["Fabian Emmes","Junio C Hamano","Lars Noschinski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"99170","messageId":"1230910814-32307-1-git-send-email-fabian.emmes@rwth-aachen.de","threadId":"16964","inReplyTo":null,"subject":"[PATCH] cvsserver: add option to configure commit message","fromName":"Fabian Emmes","fromEmail":"fabian.emmes@rwth-aachen.de","sentAt":"2009-01-02T15:40:13Z","receivedAt":"2009-01-02T15:40:13Z","isPatch":true,"sender":{"key":"fabian.emmes@rwth-aachen.de","avatar":null},"body":"cvsserver annotates each commit message by \"via git-CVS emulator\". This is\nmade configurable via gitcvs.commitmsgannotation.\n\nSigned-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de>\nSigned-off-by: Lars Noschinski <lars@public.noschinski.de>\n---\n Documentation/config.txt |    4 ++++\n git-cvsserver.perl       |    8 +++++++-\n 2 files changed, 11 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 7408bb2..8b14d8a 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -723,6 +723,10 @@ gc.rerereunresolved::\n \tkept for this many days when 'git-rerere gc' is run.\n \tThe default is 15 days.  See linkgit:git-rerere[1].\n \n+gitcvs.commitmsgannotation::\n+\tAppend this string to each commit message. Set to empty string\n+\tto disable this feature. Defaults to \"via git-CVS emulator\".\n+\n gitcvs.enabled::\n \tWhether the CVS server interface is enabled for this repository.\n \tSee linkgit:git-cvsserver[1].\ndiff --git a/git-cvsserver.perl b/git-cvsserver.perl\nindex b0a805c..cbcaeb4 100755\n--- a/git-cvsserver.perl\n+++ b/git-cvsserver.perl\n@@ -1358,7 +1358,13 @@ sub req_ci\n     # write our commit message out if we have one ...\n     my ( $msg_fh, $msg_filename ) = tempfile( DIR => $TEMP_DIR );\n     print $msg_fh $state->{opt}{m};# if ( exists ( $state->{opt}{m} ) );\n-    print $msg_fh \"\\n\\nvia git-CVS emulator\\n\";\n+    if ( defined ( $cfg->{gitcvs}{commitmsgannotation} ) ) {\n+        if ($cfg->{gitcvs}{commitmsgannotation} !~ /^\\s*$/ ) {\n+            print $msg_fh \"\\n\\n\".$cfg->{gitcvs}{commitmsgannotation}.\"\\n\"\n+        }\n+    } else {\n+        print $msg_fh \"\\n\\nvia git-CVS emulator\\n\";\n+    }\n     close $msg_fh;\n \n     my $commithash = `git-commit-tree $treehash -p $parenthash < $msg_filename`;\n-- \n1.5.6.3\n"},{"id":"99169","messageId":"1230910814-32307-2-git-send-email-fabian.emmes@rwth-aachen.de","threadId":"16964","inReplyTo":"1230910814-32307-1-git-send-email-fabian.emmes@rwth-aachen.de","subject":"[PATCH] cvsserver: change generation of CVS author names","fromName":"Fabian Emmes","fromEmail":"fabian.emmes@rwth-aachen.de","sentAt":"2009-01-02T15:40:14Z","receivedAt":"2009-01-02T15:40:14Z","isPatch":true,"sender":{"key":"fabian.emmes@rwth-aachen.de","avatar":null},"body":"CVS username is generated from local part email address.\nWe take the whole local part but restrict the character set to the\nPortable Filename Character Set, which is used for Unix login names\naccording to Single Unix Specification v3.\n\nSigned-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de>\nSigned-off-by: Lars Noschinski <lars@public.noschinski.de>\n---\n git-cvsserver.perl |   12 +++++++++---\n 1 files changed, 9 insertions(+), 3 deletions(-)\n\ndiff --git a/git-cvsserver.perl b/git-cvsserver.perl\nindex cbcaeb4..fef7faf 100755\n--- a/git-cvsserver.perl\n+++ b/git-cvsserver.perl\n@@ -2533,12 +2533,18 @@ sub open_blob_or_die\n     return $fh;\n }\n \n-# Generate a CVS author name from Git author information, by taking\n-# the first eight characters of the user part of the email address.\n+# Generate a CVS author name from Git author information, by taking the local\n+# part of the email address and replacing characters not in the Portable\n+# Filename Character Set (see IEEE Std 1003.1-2001, 3.276) by underscores. CVS\n+# Login names are Unix login names, which should be restricted to this\n+# character set.\n sub cvs_author\n {\n     my $author_line = shift;\n-    (my $author) = $author_line =~ /<([^>@]{1,8})/;\n+    (my $author) = $author_line =~ /<([^@>]*)/;\n+\n+    $author =~ s/[^-a-zA-Z0-9_.]/_/g;\n+    $author =~ s/^-/_/;\n \n     $author;\n }\n-- \n1.5.6.3\n"},{"id":"99270","messageId":"7vwsdc3ulg.fsf@gitster.siamese.dyndns.org","threadId":"16964","inReplyTo":"1230910814-32307-2-git-send-email-fabian.emmes@rwth-aachen.de","subject":"Re: [PATCH] cvsserver: change generation of CVS author names","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-03T22:14:51Z","receivedAt":"2009-01-03T22:14:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Fabian Emmes <fabian.emmes@rwth-aachen.de> writes:\n\n> CVS username is generated from local part email address.\n> We take the whole local part but restrict the character set to the\n> Portable Filename Character Set, which is used for Unix login names\n> according to Single Unix Specification v3.\n>\n> Signed-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de>\n> Signed-off-by: Lars Noschinski <lars@public.noschinski.de>\n\nStating \"we should have done this from day one\" is one thing (even though\n\"because some standard says so\" is not particularly a good justification\nwithout \"and matches the way people use CVS in the real world in practice\"\nappended to it).\n\n\"We should suddenly change the behaviour\" is quite a different thing and\nit depends on what follows that sentence if the change is justifiable.  We\ndo not want to hear \"...; screw the existing repositories if they have\nnonconforming names.\".  It is Ok if it is \"...; existing repositories will\nbe affected, but the damage is limited to very minor set of operations,\nnamely X, Y and Z\".\n\nIn other words, is there any backward compatibility issue when a\nrepository that has served existing CVS users and checkouts with older\nversion switches to the patched one?  If there is one, is that grave\nenough that we should care?\n\n>  git-cvsserver.perl |   12 +++++++++---\n>  1 files changed, 9 insertions(+), 3 deletions(-)\n>\n> diff --git a/git-cvsserver.perl b/git-cvsserver.perl\n> index cbcaeb4..fef7faf 100755\n> --- a/git-cvsserver.perl\n> +++ b/git-cvsserver.perl\n> @@ -2533,12 +2533,18 @@ sub open_blob_or_die\n>      return $fh;\n>  }\n>  \n> -# Generate a CVS author name from Git author information, by taking\n> -# the first eight characters of the user part of the email address.\n> +# Generate a CVS author name from Git author information, by taking the local\n> +# part of the email address and replacing characters not in the Portable\n> +# Filename Character Set (see IEEE Std 1003.1-2001, 3.276) by underscores. CVS\n> +# Login names are Unix login names, which should be restricted to this\n> +# character set.\n>  sub cvs_author\n>  {\n>      my $author_line = shift;\n> -    (my $author) = $author_line =~ /<([^>@]{1,8})/;\n> +    (my $author) = $author_line =~ /<([^@>]*)/;\n> +\n> +    $author =~ s/[^-a-zA-Z0-9_.]/_/g;\n> +    $author =~ s/^-/_/;\n>  \n>      $author;\n>  }\n"},{"id":"99288","messageId":"7viqovz8y0.fsf@gitster.siamese.dyndns.org","threadId":"16964","inReplyTo":"1230910814-32307-1-git-send-email-fabian.emmes@rwth-aachen.de","subject":"Re: [PATCH] cvsserver: add option to configure commit message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-04T10:01:27Z","receivedAt":"2009-01-04T10:01:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Fabian Emmes <fabian.emmes@rwth-aachen.de> writes:\n\n> cvsserver annotates each commit message by \"via git-CVS emulator\". This is\n> made configurable via gitcvs.commitmsgannotation.\n>\n> Signed-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de>\n> Signed-off-by: Lars Noschinski <lars@public.noschinski.de>\n\nI do not see the development history behind this and am somewhat puzzled\nby these two S-o-b lines.  Is it \"Fabian developed it, showed it to Lars\nwho cleaned it up and/or enhanced it and here is the result\"?  Or is it\n\"Lars developed it, circulated it in his closer circle, Fabian found it\nuseful and worthy for inclusion and sending it to the mailing list\"?\n\nWhichever it is, I just will take it as \"This is co-developed and between\nthe authors Fabian is the primary author\" and apply.\n\nThanks.\n"},{"id":"99291","messageId":"20090104111245.GA7732@lars.home.noschinski.de","threadId":"16964","inReplyTo":"7vwsdc3ulg.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] cvsserver: change generation of CVS author names","fromName":"Lars Noschinski","fromEmail":"lars@public.noschinski.de","sentAt":"2009-01-04T11:13:15Z","receivedAt":"2009-01-04T11:13:15Z","isPatch":true,"sender":{"key":"lars@public.noschinski.de","avatar":"https://gravatar.com/avatar/ca62bd8b265f2e26c89d39a4bfe7e390bfa6b16d6400e186e222d1c2382c66f2?d=mp&s=160"},"body":"* Junio C Hamano <gitster@pobox.com> [09-01-03 23:36]:\n>Fabian Emmes <fabian.emmes@rwth-aachen.de> writes:\n>\n>> CVS username is generated from local part email address.\n>> We take the whole local part but restrict the character set to the\n>> Portable Filename Character Set, which is used for Unix login names\n>> according to Single Unix Specification v3.\n>>\n>> Signed-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de>\n>> Signed-off-by: Lars Noschinski <lars@public.noschinski.de>\n>\n>Stating \"we should have done this from day one\" is one thing (even though\n>\"because some standard says so\" is not particularly a good justification\n>without \"and matches the way people use CVS in the real world in practice\"\n>appended to it).\n\nDocumentation about valid cvs/rcs usernames is a bit scarce. When we\nwrote the patch, we did not find much more information than \"the cvs\nusername is supposed to be the login name\". In my limited CVS\nexperience, I never saw CVS user names which were not (unix) login\nnames.\n\nAfter this mail, I looked to the RCS source code (see checkidentifier()\nin rcslex.c) which tells us that anything (encoded in ISO-8859-1)\nconsisting of IDCHAR, LETTER, Letter, DIGIT and PERIOD, containing at\nleast one IDCHAR, LETTER or Letter is a valid username (for the\ncharacter classes, see\nhttp://avalon.hoffentlich.net/~cebewee/rcs-charmap.txt) The most\nimportant character _not_ allowed in an user name is the @ sign, so we\ncannot use the full mail address.\n\nSo our patch generates a valid username for any \"sane\" local part. In a\nfew corner cases like \"!#$%&'*+-/=?^_`.{|}~@example.com\" our patch\ngenerates a result worse than the original - an empty username. This\nis probably something we should fix.\n\nObviously, the short names generated are not necessarily unique, which\ncan be irritating, but is not a problem from a technical point of view.\nImproving this would probably require to store a map of mail addresses\nto cvs user names.\n\n>\"We should suddenly change the behaviour\" is quite a different thing and\n>it depends on what follows that sentence if the change is justifiable.  We\n>do not want to hear \"...; screw the existing repositories if they have\n>nonconforming names.\".  It is Ok if it is \"...; existing repositories will\n>be affected, but the damage is limited to very minor set of operations,\n>namely X, Y and Z\".\n>\n>In other words, is there any backward compatibility issue when a\n>repository that has served existing CVS users and checkouts with older\n>version switches to the patched one?  If there is one, is that grave\n>enough that we should care?\n\nObviously the reported user names change. To the best of my knowledge\n(but I'm just a barely experienced CVS user) those names are not stored\nanywhere on the client and are regenerated by git-cvsserver for every\nrequest, so even old repositories get the new names for all commits.\n\n   - Lars.\n"},{"id":"99293","messageId":"20090104112318.GB7732@lars.home.noschinski.de","threadId":"16964","inReplyTo":"7viqovz8y0.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] cvsserver: add option to configure commit message","fromName":"Lars Noschinski","fromEmail":"lars@public.noschinski.de","sentAt":"2009-01-04T11:23:18Z","receivedAt":"2009-01-04T11:23:18Z","isPatch":true,"sender":{"key":"lars@public.noschinski.de","avatar":"https://gravatar.com/avatar/ca62bd8b265f2e26c89d39a4bfe7e390bfa6b16d6400e186e222d1c2382c66f2?d=mp&s=160"},"body":"* Junio C Hamano <gitster@pobox.com> [09-01-04 12:13]:\n>Fabian Emmes <fabian.emmes@rwth-aachen.de> writes:\n>\n>> cvsserver annotates each commit message by \"via git-CVS emulator\". This is\n>> made configurable via gitcvs.commitmsgannotation.\n>>\n>> Signed-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de>\n>> Signed-off-by: Lars Noschinski <lars@public.noschinski.de>\n>\n>I do not see the development history behind this and am somewhat puzzled\n>by these two S-o-b lines.  Is it \"Fabian developed it, showed it to Lars\n>who cleaned it up and/or enhanced it and here is the result\"?  Or is it\n>\"Lars developed it, circulated it in his closer circle, Fabian found it\n>useful and worthy for inclusion and sending it to the mailing list\"?\n\nIt is \"Fabian and Lars developed it and Fabian is the one who mailed it\nfor inclusion\". We could just leave off the second S-o-b line, if this\nis less irritating?\n\n>Whichever it is, I just will take it as \"This is co-developed and between\n>the authors Fabian is the primary author\" and apply.\n\nFine with me.\n\n  - Lars.\n"},{"id":"99321","messageId":"7vfxjyyj1v.fsf@gitster.siamese.dyndns.org","threadId":"16964","inReplyTo":"20090104112318.GB7732@lars.home.noschinski.de","subject":"Re: [PATCH] cvsserver: add option to configure commit message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-04T19:20:44Z","receivedAt":"2009-01-04T19:20:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Lars Noschinski <lars@public.noschinski.de> writes:\n\n> It is \"Fabian and Lars developed it and Fabian is the one who mailed it\n> for inclusion\". We could just leave off the second S-o-b line, if this\n> is less irritating?\n\nOh, no, no.  It is not an irritation at all.  I found it unusual and\nthat's all.\n\nThanks.\n"},{"id":"99434","messageId":"7vbpuklueq.fsf@gitster.siamese.dyndns.org","threadId":"16964","inReplyTo":"20090104111245.GA7732@lars.home.noschinski.de","subject":"Re: [PATCH] cvsserver: change generation of CVS author names","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-06T08:18:21Z","receivedAt":"2009-01-06T08:18:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Lars Noschinski <lars@public.noschinski.de> writes:\n\n> Obviously the reported user names change. To the best of my knowledge\n> (but I'm just a barely experienced CVS user) those names are not stored\n> anywhere on the client and are regenerated by git-cvsserver for every\n> request, so even old repositories get the new names for all commits.\n\nThanks for a clarification.  I'll amend the commit log message and queue\nthe result for 'next'.\n\ncommit d500a1ee8fe4424beb7a98e4fa6159677e7569d0\nAuthor: Fabian Emmes <fabian.emmes@rwth-aachen.de>\nDate:   Fri Jan 2 16:40:14 2009 +0100\n\n    cvsserver: change generation of CVS author names\n    \n    CVS username is generated from local part email address.\n    We take the whole local part but restrict the character set to the\n    Portable Filename Character Set, which is used for Unix login names\n    according to Single Unix Specification v3.\n    \n    This will obviously report different usernames from existing repositories\n    for commits with the local part of the author e-mail address that contains\n    characters outside the PFCS.  Hopefully this won't break an old CVS\n    checkout from an earlier version of git-cvsserver, because the names are\n    always shown afresh to the CVS clients and not kept on the client side.\n    \n    Signed-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de>\n    Signed-off-by: Lars Noschinski <lars@public.noschinski.de>\n    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n"}]}