{"thread":{"id":"37623","subject":"Fix a critical bug in git-cvsexportcommit.perl","startedAt":"2014-09-24T08:32:16Z","lastAt":"2014-09-25T03:15:51Z","messageCount":3,"participants":["Luke Lee","Stefan Beller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"249824","messageId":"wq8tquzz.fsf@gmail.com","threadId":"37623","inReplyTo":null,"subject":"Fix a critical bug in git-cvsexportcommit.perl","fromName":"Luke Lee","fromEmail":"luke.yx.lee@gmail.com","sentAt":"2014-09-24T08:32:16Z","receivedAt":"2014-09-24T08:32:16Z","isPatch":false,"sender":{"key":"luke.yx.lee@gmail.com","avatar":null},"body":"I fixed a long standing bug in git-cvsexportcommit.perl script which\ncorrupt my Perl code several times. This time I figure it out. It's\nabout keyword expansion. Take a simple example, a Perl code like this:\n\n    printf \"Perl/Tk $Tk::Version ($Tk::platform)\\n\";\n\nwill be incorrectly unexpand by git-cvsexportcommit.perl to:\n\n    printf \"Perl/Tk $Tk$Tk::platform)\\n\";\n\nThis happens when I try to export a git commit to a CVS working\ndirectory *with keyword expansion turned off*. git-cvsexportcommit will\ntry to simulate what CVS does on unexpanding keywords. However, it *DOES\nNOT* realize only valid keywords should be unexpanded. Please help apply\nthis patch.\n\nThanks.\nLuke Lee\n\n>From a33096156e376924d3a7ac2b5a42877f9aedee58 Mon Sep 17 00:00:00 2001\nFrom: Luke Lee <luke.yx.lee@gmail.com>\nDate: Wed, 24 Sep 2014 14:38:17 +0800\nSubject: [PATCH] Fix a critical bug in git-cvsexportcommit.perl about\n unexpanding keywords which incorrectly delete codes that are not expanded\n keywords.\n\n---\n git-cvsexportcommit.perl | 2 +-\n 1 file changed, 1 insertions(+), 1 deletion(-)\n\ndiff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl\nindex d13f02d..bf41a72 100755\n--- a/git-cvsexportcommit.perl\n+++ b/git-cvsexportcommit.perl\n@@ -309,7 +309,8 @@ foreach my $f (@files) {\n \twhile (<FILTER_IN>)\n \t{\n \t    my $line = $_;\n-\t    $line =~ s/\\$([A-Z][a-z]+):[^\\$]+\\$/\\$$1\\$/g;\n+\t    $line =~ s/\\$(Author|Date|Header|Id|Locker|Log|RCSfile|Revision|Source|State):[^:\\$][^\\$]+\\$/\\$$1\\$/g;\n \t    print FILTER_OUT $line;\n \t}\n \tclose FILTER_IN;\n--\n2.1.1.303.ga330961.dirty\n"},{"id":"249827","messageId":"54229AFC.6080704@gmail.com","threadId":"37623","inReplyTo":"wq8tquzz.fsf@gmail.com","subject":"Re: Fix a critical bug in git-cvsexportcommit.perl","fromName":"Stefan Beller","fromEmail":"stefanbeller@gmail.com","sentAt":"2014-09-24T10:20:44Z","receivedAt":"2014-09-24T10:20:44Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On 24.09.2014 10:32, Luke Lee wrote:\n> I fixed a long standing bug in git-cvsexportcommit.perl script which\n> corrupt my Perl code several times. This time I figure it out. It's\n> about keyword expansion. Take a simple example, a Perl code like this:\n> \n>     printf \"Perl/Tk $Tk::Version ($Tk::platform)\\n\";\n> \n> will be incorrectly unexpand by git-cvsexportcommit.perl to:\n> \n>     printf \"Perl/Tk $Tk$Tk::platform)\\n\";\n> \n> This happens when I try to export a git commit to a CVS working\n> directory *with keyword expansion turned off*. git-cvsexportcommit will\n> try to simulate what CVS does on unexpanding keywords. However, it *DOES\n> NOT* realize only valid keywords should be unexpanded. Please help apply\n> this patch.\n> \n> Thanks.\n> Luke Lee\n\nThanks for sending a patch. :)\n\n> \n> From a33096156e376924d3a7ac2b5a42877f9aedee58 Mon Sep 17 00:00:00 2001\n> From: Luke Lee <luke.yx.lee@gmail.com>\n> Date: Wed, 24 Sep 2014 14:38:17 +0800\n> Subject: [PATCH] Fix a critical bug in git-cvsexportcommit.perl about\n>  unexpanding keywords which incorrectly delete codes that are not expanded\n>  keywords.\n\nPlease have a look at Documentation/SubmittingPatches,\nalso found online at\nhttps://github.com/git/git/blob/master/Documentation/SubmittingPatches\n\nSpecially look at section \"(2) Describe your changes well.\"\nSo the headline could be shorter and then in the body of the commit\nmessage you may want to be more descriptive\n\nAlso look at section \"(5) Sign your work\"\nThis is to make sure you're legally allowed to send in the patch,\ni.e. you're doing it on your own time or your employer allowed you to\nsend code here to the mailing list.\n\n\n> \n> ---\n>  git-cvsexportcommit.perl | 2 +-\n>  1 file changed, 1 insertions(+), 1 deletion(-)\n> \n> diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl\n> index d13f02d..bf41a72 100755\n> --- a/git-cvsexportcommit.perl\n> +++ b/git-cvsexportcommit.perl\n> @@ -309,7 +309,8 @@ foreach my $f (@files) {\n>  \twhile (<FILTER_IN>)\n>  \t{\n>  \t    my $line = $_;\n> -\t    $line =~ s/\\$([A-Z][a-z]+):[^\\$]+\\$/\\$$1\\$/g;\n> +\t    $line =~ s/\\$(Author|Date|Header|Id|Locker|Log|RCSfile|Revision|Source|State):[^:\\$][^\\$]+\\$/\\$$1\\$/g;\n>  \t    print FILTER_OUT $line;\n>  \t}\n>  \tclose FILTER_IN;\n> --\n> 2.1.1.303.ga330961.dirty\n> \n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n"},{"id":"249839","messageId":"ppekl7a0.fsf@gmail.com","threadId":"37623","inReplyTo":"54229AFC.6080704@gmail.com","subject":"Re: Fix a critical bug in git-cvsexportcommit.perl","fromName":"Luke Lee","fromEmail":"luke.yx.lee@gmail.com","sentAt":"2014-09-25T03:15:51Z","receivedAt":"2014-09-25T03:15:51Z","isPatch":false,"sender":{"key":"luke.yx.lee@gmail.com","avatar":null},"body":"Stefan Beller <stefanbeller@gmail.com> writes:\n\n> Please have a look at Documentation/SubmittingPatches,\n> also found online at\n> https://github.com/git/git/blob/master/Documentation/SubmittingPatches\n>\n> Specially look at section \"(2) Describe your changes well.\"\n> So the headline could be shorter and then in the body of the commit\n> message you may want to be more descriptive\n>\n> Also look at section \"(5) Sign your work\"\n> This is to make sure you're legally allowed to send in the patch,\n> i.e. you're doing it on your own time or your employer allowed you to\n> send code here to the mailing list.\n\nI followed both (2) and (5), a new patch is generated and signed as\nfollows. Hopefully this time it fits the criteria :). Thanks.\n\n\n>From a265cffc5f5bbfb3309a5ef2b425096523c94066 Mon Sep 17 00:00:00 2001\nFrom: \"Luke Y.X. Lee\" <luke.yx.lee@gmail.com>\nDate: Thu, 25 Sep 2014 10:56:46 +0800\nSubject: [PATCH] Fix git-cvs bug that kills non-keyword source texts\n\n* git-cvsexportcommit.perl: the wild matching on unexpanding keywords\noverkilled texts that are not CVS keywords. Limits the matching to\nCVS keywords only; also prevents OO syntax that accidentally matched.\n\nSigned-off-by: Luke Y.X. Lee <luke.yx.lee@gmail.com>\n---\n git-cvsexportcommit.perl | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl\nindex d13f02d..8671d41 100755\n--- a/git-cvsexportcommit.perl\n+++ b/git-cvsexportcommit.perl\n@@ -309,7 +309,7 @@ foreach my $f (@files) {\n \twhile (<FILTER_IN>)\n \t{\n \t    my $line = $_;\n-\t    $line =~ s/\\$([A-Z][a-z]+):[^\\$]+\\$/\\$$1\\$/g;\n+\t    $line =~ s/\\$(Author|Date|Header|Id|Locker|Log|RCSfile|Revision|Source|State):[^:\\$][^\\$]*\\$/\\$$1\\$/g;\n \t    print FILTER_OUT $line;\n \t}\n \tclose FILTER_IN;\n-- \n2.1.1.304.gb913e04\n"}]}