{"thread":{"id":"12361","subject":"[PATCH] cvsimport: have default merge regex allow for dashes in the branch name","startedAt":"2008-02-28T10:18:20Z","lastAt":"2008-03-01T20:24:39Z","messageCount":9,"participants":["Philippe Bruhat (BooK)","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"70235","messageId":"1204193904-3652-1-git-send-email-book@cpan.org","threadId":"12361","inReplyTo":null,"subject":"Multiple -M options for git-cvsimport","fromName":"Philippe Bruhat (BooK)","fromEmail":"book@cpan.org","sentAt":"2008-02-28T10:18:20Z","receivedAt":"2008-02-28T10:18:20Z","isPatch":false,"sender":{"key":"book@cpan.org","avatar":"https://avatars.githubusercontent.com/u/44421?v=4"},"body":"Sending again my series of patches to git-cvsimport, which allow to\nuse several -M options for giving the regular expressions capturing the\nsource branch name when merging.\n\nSigned-off-by: Philippe Bruhat (BooK) <book@cpan.org>\n"},{"id":"70233","messageId":"1204193904-3652-2-git-send-email-book@cpan.org","threadId":"12361","inReplyTo":"1204193904-3652-1-git-send-email-book@cpan.org","subject":"[PATCH] cvsimport: have default merge regex allow for dashes in the branch name","fromName":"Philippe Bruhat (BooK)","fromEmail":"book@cpan.org","sentAt":"2008-02-28T10:18:21Z","receivedAt":"2008-02-28T10:18:21Z","isPatch":true,"sender":{"key":"book@cpan.org","avatar":"https://avatars.githubusercontent.com/u/44421?v=4"},"body":"From: Philippe Bruhat (BooK <book@cpan.org>\n\nThe default value of @mergerx uses \\w, which matches word\ncharacter; a branch name like policy-20050608-br will not be\nmatched.\n---\n git-cvsimport.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex 9516242..3d013a7 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -164,7 +164,7 @@ if ($#ARGV == 0) {\n \n our @mergerx = ();\n if ($opt_m) {\n-\t@mergerx = ( qr/\\b(?:from|of|merge|merging|merged) (\\w+)/i );\n+\t@mergerx = ( qr/\\b(?:from|of|merge|merging|merged) ([-\\w]+)/i );\n }\n if ($opt_M) {\n \tpush (@mergerx, qr/$opt_M/);\n-- \n1.5.4.2.187.gfc276\n"},{"id":"70234","messageId":"1204193904-3652-3-git-send-email-book@cpan.org","threadId":"12361","inReplyTo":"1204193904-3652-2-git-send-email-book@cpan.org","subject":"[PATCH] cvsimport: allow for multiple -M options","fromName":"Philippe Bruhat (BooK)","fromEmail":"book@cpan.org","sentAt":"2008-02-28T10:18:22Z","receivedAt":"2008-02-28T10:18:22Z","isPatch":true,"sender":{"key":"book@cpan.org","avatar":"https://avatars.githubusercontent.com/u/44421?v=4"},"body":"From: Philippe Bruhat (BooK <book@cpan.org>\n\nUse Getopt::Long instead of Getopt::Std to handle multiple -M options,\nfor all the cases when having a single custom regex is not enough.\n\nFor example, \"merged (\\w+)\" and \"(\\w+) merged\" can't be easily turned\ninto a single regular expression capturing the branch name in $1.\n---\n git-cvsimport.perl |   15 ++++++++++-----\n 1 files changed, 10 insertions(+), 5 deletions(-)\n\ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex 3d013a7..f138a01 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -15,7 +15,7 @@\n \n use strict;\n use warnings;\n-use Getopt::Std;\n+use Getopt::Long;\n use File::Spec;\n use File::Temp qw(tempfile tmpnam);\n use File::Path qw(mkpath);\n@@ -29,7 +29,7 @@ use IPC::Open2;\n $SIG{'PIPE'}=\"IGNORE\";\n $ENV{'TZ'}=\"UTC\";\n \n-our ($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_P, $opt_s,$opt_m,$opt_M,$opt_A,$opt_S,$opt_L, $opt_a, $opt_r);\n+our ($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_P, $opt_s,$opt_m,@opt_M,$opt_A,$opt_S,$opt_L, $opt_a, $opt_r);\n my (%conv_author_name, %conv_author_email);\n \n sub usage(;$) {\n@@ -112,7 +112,12 @@ sub read_repo_config {\n \n my $opts = \"haivmkuo:d:p:r:C:z:s:M:P:A:S:L:\";\n read_repo_config($opts);\n-getopts($opts) or usage();\n+Getopt::Long::Configure( 'no_ignore_case' );\n+\n+# turn the Getopt::Std specification in a Getopt::Long one,\n+# with support for multiple -M options\n+GetOptions( map { s/:/=s/; /M/ ? \"$_\\@\" : $_ } split( /(?!:)/, $opts ) )\n+    or usage();\n usage if $opt_h;\n \n if (@ARGV == 0) {\n@@ -166,8 +171,8 @@ our @mergerx = ();\n if ($opt_m) {\n \t@mergerx = ( qr/\\b(?:from|of|merge|merging|merged) ([-\\w]+)/i );\n }\n-if ($opt_M) {\n-\tpush (@mergerx, qr/$opt_M/);\n+if (@opt_M) {\n+\tpush (@mergerx, map { qr/$_/ } @opt_M);\n }\n \n # Remember UTC of our starting time\n-- \n1.5.4.2.187.gfc276\n"},{"id":"70237","messageId":"1204193904-3652-4-git-send-email-book@cpan.org","threadId":"12361","inReplyTo":"1204193904-3652-3-git-send-email-book@cpan.org","subject":"[PATCH] cvsimport: document that -M can be used multiple times","fromName":"Philippe Bruhat (BooK)","fromEmail":"book@cpan.org","sentAt":"2008-02-28T10:18:23Z","receivedAt":"2008-02-28T10:18:23Z","isPatch":true,"sender":{"key":"book@cpan.org","avatar":"https://avatars.githubusercontent.com/u/44421?v=4"},"body":"From: Philippe Bruhat (BooK <book@cpan.org>\n\nAlso document the capture behaviour (source branch name in $1)\n\nSigned-off-by: Philippe Bruhat (BooK) <book@cpan.org>\n---\n Documentation/git-cvsimport.txt |    6 +++++-\n 1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt\nindex 6f91b9e..58eefd4 100644\n--- a/Documentation/git-cvsimport.txt\n+++ b/Documentation/git-cvsimport.txt\n@@ -102,13 +102,17 @@ If you need to pass multiple options, separate them with a comma.\n \n -m::\n \tAttempt to detect merges based on the commit message. This option\n-\twill enable default regexes that try to capture the name source\n+\twill enable default regexes that try to capture the source\n \tbranch name from the commit message.\n \n -M <regex>::\n \tAttempt to detect merges based on the commit message with a custom\n \tregex. It can be used with '-m' to enable the default regexes\n \tas well. You must escape forward slashes.\n++\n+The regex must capture the source branch name in $1.\n++\n+This option can be used several times to provide several detection regexes.\n \n -S <regex>::\n \tSkip paths matching the regex.\n-- \n1.5.4.2.187.gfc276\n"},{"id":"70236","messageId":"1204193904-3652-5-git-send-email-book@cpan.org","threadId":"12361","inReplyTo":"1204193904-3652-4-git-send-email-book@cpan.org","subject":"[PATCH] cvsimport: configure Getopt::Long to bundle options","fromName":"Philippe Bruhat (BooK)","fromEmail":"book@cpan.org","sentAt":"2008-02-28T10:18:24Z","receivedAt":"2008-02-28T10:18:24Z","isPatch":true,"sender":{"key":"book@cpan.org","avatar":"https://avatars.githubusercontent.com/u/44421?v=4"},"body":"---\n git-cvsimport.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex f138a01..47f116f 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -112,7 +112,7 @@ sub read_repo_config {\n \n my $opts = \"haivmkuo:d:p:r:C:z:s:M:P:A:S:L:\";\n read_repo_config($opts);\n-Getopt::Long::Configure( 'no_ignore_case' );\n+Getopt::Long::Configure( 'no_ignore_case', 'bundling' );\n \n # turn the Getopt::Std specification in a Getopt::Long one,\n # with support for multiple -M options\n-- \n1.5.4.2.187.gfc276\n"},{"id":"70295","messageId":"7vzltkj14d.fsf@gitster.siamese.dyndns.org","threadId":"12361","inReplyTo":"1204193904-3652-1-git-send-email-book@cpan.org","subject":"Re: Multiple -M options for git-cvsimport","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-28T20:07:46Z","receivedAt":"2008-02-28T20:07:46Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Philippe Bruhat (BooK)\" <book@cpan.org> writes:\n\n> Sending again my series of patches to git-cvsimport, which allow to\n> use several -M options for giving the regular expressions capturing the\n> source branch name when merging.\n\nCould you be a bit more explicit than \"Sending again\", describe\nif it is just a straight resend, or what problems were pointed\nout in the earlier round (if any) and how they were addressed\n(or ignored, if any)?\n\nAlso please Sign-off all your patches.  Cover letters do not\nneed one.\n\nI'll take a look at them later, when I have enough time to fish\nfor messages and discussions from earlier round in the list\narchive in order to process this.\n\nThanks.\n"},{"id":"70374","messageId":"20080229100241.GA6777@plop.home.bruhat.net","threadId":"12361","inReplyTo":"7vzltkj14d.fsf@gitster.siamese.dyndns.org","subject":"Re: Multiple -M options for git-cvsimport","fromName":"Philippe Bruhat (BooK)","fromEmail":"book@cpan.org","sentAt":"2008-02-29T10:02:41Z","receivedAt":"2008-02-29T10:02:41Z","isPatch":false,"sender":{"key":"book@cpan.org","avatar":"https://avatars.githubusercontent.com/u/44421?v=4"},"body":"On Thu, Feb 28, 2008 at 12:07:46PM -0800, Junio C Hamano wrote:\n> \"Philippe Bruhat (BooK)\" <book@cpan.org> writes:\n> \n> > Sending again my series of patches to git-cvsimport, which allow to\n> > use several -M options for giving the regular expressions capturing the\n> > source branch name when merging.\n> \n> Could you be a bit more explicit than \"Sending again\", describe\n> if it is just a straight resend, or what problems were pointed\n> out in the earlier round (if any) and how they were addressed\n> (or ignored, if any)?\n\nSorry.\n\nIn the previous round, an asciidoc formatting error was pointed in my\ndoc patch, and you also noted that the t/t9600-cvsimport.sh test script\nfailed after my Getopt::Std -> Getopt::Long patch.\n\nI corrected all those problems (checked the asciidoc HTML output, and\nmade sure the test script passed again).\n\n> Also please Sign-off all your patches.  Cover letters do not\n> need one.\n\nIt noticed that I forgot to -s my commits, so I thought that signing off\nthe cover letter would be equivalent. I tried to follow the guidelines\nfor sending patches, using format-patch and send-email, but I'm still a\nnewbie both to git and it's development model.\n\n> I'll take a look at them later, when I have enough time to fish\n> for messages and discussions from earlier round in the list\n> archive in order to process this.\n\nYou can ignore my previous messages, then. These four patches were\nrebased on the top of master, and correct the problems that were\npreviously pointed to me.\n\n    Thanks,\n\n-- \n Philippe Bruhat (BooK)\n\n The shortest distance between two points is not always the safest.\n                                    (Moral from Groo The Wanderer #69 (Epic))\n"},{"id":"70478","messageId":"7vejav7zns.fsf@gitster.siamese.dyndns.org","threadId":"12361","inReplyTo":"20080229100241.GA6777@plop.home.bruhat.net","subject":"Re: Multiple -M options for git-cvsimport","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-01T05:59:19Z","receivedAt":"2008-03-01T05:59:19Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Philippe Bruhat (BooK)\" <book@cpan.org> writes:\n\n> On Thu, Feb 28, 2008 at 12:07:46PM -0800, Junio C Hamano wrote:\n>\n>> I'll take a look at them later, when I have enough time to fish\n>> for messages and discussions from earlier round in the list\n>> archive in order to process this.\n>\n> You can ignore my previous messages, then. These four patches were\n> rebased on the top of master, and correct the problems that were\n> previously pointed to me.\n\nI do not work that way.  I am a trust-but-verify kind of person.\n\nSo I dug up the old ones and the discussion.  The series looks\nfine.\n\ncvsimport: have default merge regex allow for dashes in the branch name\n\n  You can extend the default with -M anyway, but I guess the\n  default pattern can be loosened like this without increasing\n  the risk of false hits, so probably it is Ok.\n\ncvsimport: allow for multiple -M options\n\n  Ok.\n\ncvsimport: document that -M can be used multiple times\n\n  Ok, except that \"can be used seveval times\" should probably be\n  \"can be used more than once\".\n\ncvsimport: configure Getopt::Long to bundle options\n\n  Ok.  Why isn't bundling the default, I have to wonder...\n\n"},{"id":"70551","messageId":"7vbq5yyyyg.fsf@gitster.siamese.dyndns.org","threadId":"12361","inReplyTo":"7vejav7zns.fsf@gitster.siamese.dyndns.org","subject":"Re: Multiple -M options for git-cvsimport","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-01T20:24:39Z","receivedAt":"2008-03-01T20:24:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"Philippe Bruhat (BooK)\" <book@cpan.org> writes:\n>\n>> On Thu, Feb 28, 2008 at 12:07:46PM -0800, Junio C Hamano wrote:\n>>\n>>> I'll take a look at them later, when I have enough time to fish\n>>> for messages and discussions from earlier round in the list\n>>> archive in order to process this.\n>>\n>> You can ignore my previous messages, then. These four patches were\n>> rebased on the top of master, and correct the problems that were\n>> previously pointed to me.\n>\n> I do not work that way.  I am a trust-but-verify kind of person.\n>\n> So I dug up the old ones and the discussion.  The series looks\n> fine.\n> ...\n> cvsimport: have default merge regex allow for dashes in the branch name\n> ...\n> cvsimport: allow for multiple -M options\n>\n>   Ok.\n> ...\n> cvsimport: document that -M can be used multiple times\n> cvsimport: configure Getopt::Long to bundle options\n>\n>   Ok.  Why isn't bundling the default, I have to wonder...\n\nI take these back.  \n\nThe last one is an \"Oops, the second one was an utter crap, it does not\neven pass the testsuite, well let's patch it up with an extra commit at\nthe end.\"\n\nPlease don't do this.  We do not have to record earlier mistakes in the\npublic history.\n\nI've squashed 4/4 into 2/4 and made it a 3-patch series.\n"}]}