{"thread":{"id":"41162","subject":"[PATCH] git-svn: loosen config globs limitations","startedAt":"2016-01-11T14:25:58Z","lastAt":"2016-01-27T20:26:36Z","messageCount":10,"participants":["Victor Leschuk","Eric Wong","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"275644","messageId":"1452522358-16943-1-git-send-email-vleschuk@accesssoftek.com","threadId":"41162","inReplyTo":null,"subject":"[PATCH] git-svn: loosen config globs limitations","fromName":"Victor Leschuk","fromEmail":"vleschuk@gmail.com","sentAt":"2016-01-11T14:25:58Z","receivedAt":"2016-01-11T14:25:58Z","isPatch":true,"sender":{"key":"vleschuk@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1045374?v=4"},"body":"Expand the area of globs applicability for branches and tags\nin git-svn. It is now possible to use globs like 'a*e', or 'release_*'.\nThis allows users to avoid long lines in config like:\n\nbranches = branches/{release_20,release_21,release_22,...}\n\nSigned-off-by: Victor Leschuk <vleschuk@accesssoftek.com>\n---\nChanges from $gmane/283172:\n  * Not only prefixed globs are allowed now (one can put '*' in the middle of a word) - thus changed patch name\n  * Added tests for globs in the middle of a word\n\n Documentation/git-svn.txt                  |  12 ++\n perl/Git/SVN/GlobSpec.pm                   |  12 +-\n t/t9168-git-svn-partially-globbed-names.sh | 222 +++++++++++++++++++++++++++++\n 3 files changed, 241 insertions(+), 5 deletions(-)\n create mode 100755 t/t9168-git-svn-partially-globbed-names.sh\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 0c0f60b..fb23a98 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -1034,6 +1034,8 @@ listed below are allowed:\n \turl = http://server.org/svn\n \tfetch = trunk/project-a:refs/remotes/project-a/trunk\n \tbranches = branches/*/project-a:refs/remotes/project-a/branches/*\n+\tbranches = branches/release_*:refs/remotes/project-a/branches/release_*\n+\tbranches = branches/re*se:refs/remotes/project-a/branches/*\n \ttags = tags/*/project-a:refs/remotes/project-a/tags/*\n ------------------------------------------------------------------------\n \n@@ -1044,6 +1046,16 @@ independent path component (surrounded by '/' or EOL).   This\n type of configuration is not automatically created by 'init' and\n should be manually entered with a text-editor or using 'git config'.\n \n+Also note that only one asterisk is allowed per word. For example:\n+\n+\tbranches = branches/re*se:refs/remotes/project-a/branches/*\n+\n+will match branches 'release', 'rese', 're123se', however\n+\n+\tbranches = branches/re*s*e:refs/remotes/project-a/branches/*\n+\n+will produce an error.\n+\n It is also possible to fetch a subset of branches or tags by using a\n comma-separated list of names within braces. For example:\n \ndiff --git a/perl/Git/SVN/GlobSpec.pm b/perl/Git/SVN/GlobSpec.pm\nindex c95f5d7..1248e6d 100644\n--- a/perl/Git/SVN/GlobSpec.pm\n+++ b/perl/Git/SVN/GlobSpec.pm\n@@ -11,16 +11,18 @@ sub new {\n \tmy $die_msg = \"Only one set of wildcard directories \" .\n \t\t\t\t\"(e.g. '*' or '*/*/*') is supported: '$glob'\\n\";\n \tfor my $part (split(m|/|, $glob)) {\n-\t\tif ($part =~ /\\*/ && $part ne \"*\") {\n-\t\t\tdie \"Invalid pattern in '$glob': $part\\n\";\n-\t\t} elsif ($pattern_ok && $part =~ /[{}]/ &&\n+\t\tif ($pattern_ok && $part =~ /[{}]/ &&\n \t\t\t $part !~ /^\\{[^{}]+\\}/) {\n \t\t\tdie \"Invalid pattern in '$glob': $part\\n\";\n \t\t}\n-\t\tif ($part eq \"*\") {\n+\t\tmy $nstars = $part =~ tr/\\*//;\n+\t\tdie \"Only one '*' is allowed in a pattern: '$part'\\n\" if $nstars > 1;\n+\t\tif ($part =~ /(.*)\\*(.*)/) {\n \t\t\tdie $die_msg if $state eq \"right\";\n+\t\t\tmy ($l, $r) = ($1, $2);\n \t\t\t$state = \"pattern\";\n-\t\t\tpush(@patterns, \"[^/]*\");\n+\t\t\tmy $pat = quotemeta($l) . '[^/]*' . quotemeta($r);\n+\t\t\tpush(@patterns, $pat);\n \t\t} elsif ($pattern_ok && $part =~ /^\\{(.*)\\}$/) {\n \t\t\tdie $die_msg if $state eq \"right\";\n \t\t\t$state = \"pattern\";\ndiff --git a/t/t9168-git-svn-partially-globbed-names.sh b/t/t9168-git-svn-partially-globbed-names.sh\nnew file mode 100755\nindex 0000000..8e4100a\n--- /dev/null\n+++ b/t/t9168-git-svn-partially-globbed-names.sh\n@@ -0,0 +1,222 @@\n+#!/bin/sh\n+test_description='git svn globbing refspecs with prefixed globs'\n+. ./lib-git-svn.sh\n+\n+test_expect_success 'prepare test refspec prefixed globbing' '\n+\tcat >expect.end <<EOF\n+the end\n+hi\n+start a new branch\n+initial\n+EOF\n+\t'\n+\n+test_expect_success 'test refspec prefixed globbing' '\n+\tmkdir -p trunk/src/a trunk/src/b trunk/doc &&\n+\techo \"hello world\" >trunk/src/a/readme &&\n+\techo \"goodbye world\" >trunk/src/b/readme &&\n+\tsvn_cmd import -m \"initial\" trunk \"$svnrepo\"/trunk &&\n+\tsvn_cmd co \"$svnrepo\" tmp &&\n+\t(\n+\t\tcd tmp &&\n+\t\tmkdir branches tags &&\n+\t\tsvn_cmd add branches tags &&\n+\t\tsvn_cmd cp trunk branches/b_start &&\n+\t\tsvn_cmd commit -m \"start a new branch\" &&\n+\t\tsvn_cmd up &&\n+\t\techo \"hi\" >>branches/b_start/src/b/readme &&\n+\t\tpoke branches/b_start/src/b/readme &&\n+\t\techo \"hey\" >>branches/b_start/src/a/readme &&\n+\t\tpoke branches/b_start/src/a/readme &&\n+\t\tsvn_cmd commit -m \"hi\" &&\n+\t\tsvn_cmd up &&\n+\t\tsvn_cmd cp branches/b_start tags/t_end &&\n+\t\techo \"bye\" >>tags/t_end/src/b/readme &&\n+\t\tpoke tags/t_end/src/b/readme &&\n+\t\techo \"aye\" >>tags/t_end/src/a/readme &&\n+\t\tpoke tags/t_end/src/a/readme &&\n+\t\tsvn_cmd commit -m \"the end\" &&\n+\t\techo \"byebye\" >>tags/t_end/src/b/readme &&\n+\t\tpoke tags/t_end/src/b/readme &&\n+\t\tsvn_cmd commit -m \"nothing to see here\"\n+\t) &&\n+\tgit config --add svn-remote.svn.url \"$svnrepo\" &&\n+\tgit config --add svn-remote.svn.fetch \\\n+\t                 \"trunk/src/a:refs/remotes/trunk\" &&\n+\tgit config --add svn-remote.svn.branches \\\n+\t                 \"branches/b_*/src/a:refs/remotes/branches/b_*\" &&\n+\tgit config --add svn-remote.svn.tags\\\n+\t                 \"tags/t_*/src/a:refs/remotes/tags/t_*\" &&\n+\tgit svn multi-fetch &&\n+\tgit log --pretty=oneline refs/remotes/tags/t_end | \\\n+\t    sed -e \"s/^.\\{41\\}//\" >output.end &&\n+\ttest_cmp expect.end output.end &&\n+\ttest \"$(git rev-parse refs/remotes/tags/t_end~1)\" = \\\n+\t\t\"$(git rev-parse refs/remotes/branches/b_start)\" &&\n+\ttest \"$(git rev-parse refs/remotes/branches/b_start~2)\" = \\\n+\t\t\"$(git rev-parse refs/remotes/trunk)\" &&\n+\ttest_must_fail git rev-parse refs/remotes/tags/t_end@3\n+\t'\n+\n+test_expect_success 'prepare test left-hand-side only prefixed globbing' '\n+\techo try to try >expect.two &&\n+\techo nothing to see here >>expect.two &&\n+\tcat expect.end >>expect.two\n+\t'\n+\n+test_expect_success 'test left-hand-side only prefixed globbing' '\n+\tgit config --add svn-remote.two.url \"$svnrepo\" &&\n+\tgit config --add svn-remote.two.fetch trunk:refs/remotes/two/trunk &&\n+\tgit config --add svn-remote.two.branches \\\n+\t                 \"branches/b_*:refs/remotes/two/branches/*\" &&\n+\tgit config --add svn-remote.two.tags \\\n+\t                 \"tags/t_*:refs/remotes/two/tags/*\" &&\n+\t(\n+\t\tcd tmp &&\n+\t\techo \"try try\" >>tags/t_end/src/b/readme &&\n+\t\tpoke tags/t_end/src/b/readme &&\n+\t\tsvn_cmd commit -m \"try to try\"\n+\t) &&\n+\tgit svn fetch two &&\n+\ttest $(git rev-list refs/remotes/two/tags/t_end | wc -l) -eq 6 &&\n+\ttest $(git rev-list refs/remotes/two/branches/b_start | wc -l) -eq 3 &&\n+\ttest $(git rev-parse refs/remotes/two/branches/b_start~2) = \\\n+\t     $(git rev-parse refs/remotes/two/trunk) &&\n+\ttest $(git rev-parse refs/remotes/two/tags/t_end~3) = \\\n+\t     $(git rev-parse refs/remotes/two/branches/b_start) &&\n+\tgit log --pretty=oneline refs/remotes/two/tags/t_end | \\\n+\t    sed -e \"s/^.\\{41\\}//\" >output.two &&\n+\ttest_cmp expect.two output.two\n+\t'\n+\n+test_expect_success 'prepare test prefixed globs match just prefix' '\n+\tcat >expect.three <<EOF\n+Tag commit to t_\n+Branch commit to b_\n+initial\n+EOF\n+\t'\n+\n+test_expect_success 'test prefixed globs match just prefix' '\n+\tgit config --add svn-remote.three.url \"$svnrepo\" &&\n+\tgit config --add svn-remote.three.fetch \\\n+\t                 trunk:refs/remotes/three/trunk &&\n+\tgit config --add svn-remote.three.branches \\\n+\t                 \"branches/b_*:refs/remotes/three/branches/*\" &&\n+\tgit config --add svn-remote.three.tags \\\n+\t                 \"tags/t_*:refs/remotes/three/tags/*\" &&\n+\t(\n+\t\tcd tmp &&\n+\t\tsvn_cmd cp trunk branches/b_ &&\n+\t\techo \"Branch commit to b_\" >>branches/b_/src/a/readme &&\n+\t\tpoke branches/b_/src/a/readme &&\n+\t\tsvn_cmd commit -m \"Branch commit to b_\" &&\n+\t\tsvn_cmd up && svn_cmd cp branches/b_ tags/t_ &&\n+\t\techo \"Tag commit to t_\" >>tags/t_/src/a/readme &&\n+\t\tpoke tags/t_/src/a/readme &&\n+\t\tsvn_cmd commit -m \"Tag commit to t_\" &&\n+\t\tsvn_cmd up\n+\t) &&\n+\tgit svn fetch three &&\n+\ttest $(git rev-list refs/remotes/three/branches/b_ | wc -l) -eq 2 &&\n+\ttest $(git rev-list refs/remotes/three/tags/t_ | wc -l) -eq 3 &&\n+\ttest $(git rev-parse refs/remotes/three/branches/b_~1) = \\\n+\t     $(git rev-parse refs/remotes/three/trunk) &&\n+\ttest $(git rev-parse refs/remotes/three/tags/t_~1) = \\\n+\t     $(git rev-parse refs/remotes/three/branches/b_) &&\n+\tgit log --pretty=oneline refs/remotes/three/tags/t_ | \\\n+\t    sed -e \"s/^.\\{41\\}//\" >output.three &&\n+\ttest_cmp expect.three output.three\n+\t'\n+\n+test_expect_success 'prepare test disallow prefixed multi-globs' \"\n+\techo \\\"Only one set of wildcard directories\\\" \\\n+\t     \\\"(e.g. '*' or '*/*/*') is supported: 'branches/b_*/t/*'\\\" >expect.four &&\n+\techo \\\"\\\" >>expect.four\n+\t\"\n+\n+test_expect_success 'test disallow prefixed multi-globs' '\n+\tgit config --add svn-remote.four.url \"$svnrepo\" &&\n+\tgit config --add svn-remote.four.fetch \\\n+\t                 trunk:refs/remotes/four/trunk &&\n+\tgit config --add svn-remote.four.branches \\\n+\t                 \"branches/b_*/t/*:refs/remotes/four/branches/*\" &&\n+\tgit config --add svn-remote.four.tags \\\n+\t                 \"tags/t_*/*:refs/remotes/four/tags/*\" &&\n+\t(\n+\t\tcd tmp &&\n+\t\techo \"try try\" >>tags/t_end/src/b/readme &&\n+\t\tpoke tags/t_end/src/b/readme &&\n+\t\tsvn_cmd commit -m \"try to try\"\n+\t) &&\n+\ttest_must_fail git svn fetch four 2>stderr.four &&\n+\ttest_cmp expect.four stderr.four &&\n+\tgit config --unset svn-remote.four.branches &&\n+\tgit config --unset svn-remote.four.tags\n+\t'\n+\n+test_expect_success 'prepare test globbing in the middle of the word' '\n+\tcat >expect.five <<EOF\n+Tag commit to fghij\n+Branch commit to abcde\n+initial\n+EOF\n+\t'\n+\n+test_expect_success 'test globbing in the middle of the word' '\n+\tgit config --add svn-remote.five.url \"$svnrepo\" &&\n+\tgit config --add svn-remote.five.fetch \\\n+\t                 trunk:refs/remotes/five/trunk &&\n+\tgit config --add svn-remote.five.branches \\\n+\t                 \"branches/a*e:refs/remotes/five/branches/*\" &&\n+\tgit config --add svn-remote.five.tags \\\n+\t                 \"tags/f*j:refs/remotes/five/tags/*\" &&\n+\t(\n+\t\tcd tmp &&\n+\t\tsvn_cmd cp trunk branches/abcde &&\n+\t\techo \"Branch commit to abcde\" >>branches/abcde/src/a/readme &&\n+\t\tpoke branches/b_/src/a/readme &&\n+\t\tsvn_cmd commit -m \"Branch commit to abcde\" &&\n+\t\tsvn_cmd up &&\n+\t\tsvn_cmd cp branches/abcde tags/fghij &&\n+\t\techo \"Tag commit to fghij\" >>tags/fghij/src/a/readme &&\n+\t\tpoke tags/fghij/src/a/readme &&\n+\t\tsvn_cmd commit -m \"Tag commit to fghij\" &&\n+\t\tsvn_cmd up\n+\t) &&\n+\tgit svn fetch five &&\n+\ttest $(git rev-list refs/remotes/five/branches/abcde | wc -l) -eq 2 &&\n+\ttest $(git rev-list refs/remotes/five/tags/fghij | wc -l) -eq 3 &&\n+\ttest $(git rev-parse refs/remotes/five/branches/abcde~1) = \\\n+\t     $(git rev-parse refs/remotes/five/trunk) &&\n+\ttest $(git rev-parse refs/remotes/five/tags/fghij~1) = \\\n+\t     $(git rev-parse refs/remotes/five/branches/abcde) &&\n+\tgit log --pretty=oneline refs/remotes/five/tags/fghij | \\\n+\t    sed -e \"s/^.\\{41\\}//\" >output.five &&\n+\ttest_cmp expect.five output.five\n+\t'\n+\n+test_expect_success 'prepare test disallow multiple asterisks in one word' \"\n+\techo \\\"Only one '*' is allowed in a pattern: 'a*c*e'\\\" >expect.six &&\n+\techo \\\"\\\" >>expect.six\n+\t\"\n+\n+test_expect_success 'test disallow multiple asterisks in one word' '\n+\tgit config --add svn-remote.six.url \"$svnrepo\" &&\n+\tgit config --add svn-remote.six.fetch \\\n+\t                 trunk:refs/remotes/six/trunk &&\n+\tgit config --add svn-remote.six.branches \\\n+\t                 \"branches/a*c*e:refs/remotes/six/branches/*\" &&\n+\tgit config --add svn-remote.six.tags \\\n+\t                 \"tags/f*h*j:refs/remotes/six/tags/*\" &&\n+\t(\n+\t\tcd tmp &&\n+\t\techo \"try try\" >>tags/fghij/src/b/readme &&\n+\t\tpoke tags/fghij/src/b/readme &&\n+\t\tsvn_cmd commit -m \"try to try\"\n+\t) &&\n+\ttest_must_fail git svn fetch six 2>stderr.six &&\n+\ttest_cmp expect.six stderr.six\n+\t'\n+\n+test_done\n-- \n2.7.0.1.g72018be.dirty\n"},{"id":"275862","messageId":"20160113031601.GA28224@dcvr.yhbt.net","threadId":"41162","inReplyTo":"1452522358-16943-1-git-send-email-vleschuk@accesssoftek.com","subject":"Re: [PATCH] git-svn: loosen config globs limitations","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2016-01-13T03:16:01Z","receivedAt":"2016-01-13T03:16:01Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Thanks, I made a minor cleanup and applied with --whitespace=fix\nto remove spaces from indentation.\n\n--- a/perl/Git/SVN/GlobSpec.pm\n+++ b/perl/Git/SVN/GlobSpec.pm\n@@ -15,8 +15,10 @@ sub new {\n \t\t\t $part !~ /^\\{[^{}]+\\}/) {\n \t\t\tdie \"Invalid pattern in '$glob': $part\\n\";\n \t\t}\n-\t\tmy $nstars = $part =~ tr/\\*//;\n-\t\tdie \"Only one '*' is allowed in a pattern: '$part'\\n\" if $nstars > 1;\n+\t\tmy $nstars = $part =~ tr/*//;\n+\t\tif ($nstars > 1) {\n+\t\t\tdie \"Only one '*' is allowed in a pattern: '$part'\\n\";\n+\t\t}\n \t\tif ($part =~ /(.*)\\*(.*)/) {\n \t\t\tdie $die_msg if $state eq \"right\";\n \t\t\tmy ($l, $r) = ($1, $2);\n\nSo I'll push out with the following commit message:\n\nSubject: [PATCH] git-svn: loosen config globs limitations\n\nExpand the area of globs applicability for branches and tags\nin git-svn. It is now possible to use globs like 'a*e', or 'release_*'.\nThis allows users to avoid long lines in config like:\n\n\tbranches = branches/{release_20,release_21,release_22,...}\n\nIn favor of:\n\n\tbranches = branches/release_*\n\n[ew: amended commit message, minor formatting and style fixes]\n\nSigned-off-by: Victor Leschuk <vleschuk@accesssoftek.com>\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n\n\n\nI also noticed the \"Only one set of wildcard directories\" error\nmessage is unnecessary long and \"wildcard directories\" should\nprobably be shortened to \"wildcards\" to avoid wrapping in a terminal.\nThat will probably be a separate patch for me.\n"},{"id":"275870","messageId":"6AE1604EE3EC5F4296C096518C6B77EE5FF2055FF9@mail.accesssoftek.com","threadId":"41162","inReplyTo":"20160113031601.GA28224@dcvr.yhbt.net","subject":"RE: [PATCH] git-svn: loosen config globs limitations","fromName":"Victor Leschuk","fromEmail":"vleschuk@accesssoftek.com","sentAt":"2016-01-13T06:40:00Z","receivedAt":"2016-01-13T06:40:00Z","isPatch":true,"sender":{"key":"vleschuk@accesssoftek.com","avatar":null},"body":"Thanks a lot Eric,\n\nI agree with all corrections, I also noticed the \"wildcard directories\" message situation when was creating test for the patch, however didn't want mix up unrelated changes for this patchset.\n\n--\nBest Regards,\nVictor\n________________________________________\nFrom: Eric Wong [normalperson@yhbt.net]\nSent: Tuesday, January 12, 2016 19:16\nTo: Victor Leschuk\nCc: git@vger.kernel.org; Victor Leschuk; gitster@pobox.com\nSubject: Re: [PATCH] git-svn: loosen config globs limitations\n\nThanks, I made a minor cleanup and applied with --whitespace=fix\nto remove spaces from indentation.\n\n--- a/perl/Git/SVN/GlobSpec.pm\n+++ b/perl/Git/SVN/GlobSpec.pm\n@@ -15,8 +15,10 @@ sub new {\n                         $part !~ /^\\{[^{}]+\\}/) {\n                        die \"Invalid pattern in '$glob': $part\\n\";\n                }\n-               my $nstars = $part =~ tr/\\*//;\n-               die \"Only one '*' is allowed in a pattern: '$part'\\n\" if $nstars > 1;\n+               my $nstars = $part =~ tr/*//;\n+               if ($nstars > 1) {\n+                       die \"Only one '*' is allowed in a pattern: '$part'\\n\";\n+               }\n                if ($part =~ /(.*)\\*(.*)/) {\n                        die $die_msg if $state eq \"right\";\n                        my ($l, $r) = ($1, $2);\n\nSo I'll push out with the following commit message:\n\nSubject: [PATCH] git-svn: loosen config globs limitations\n\nExpand the area of globs applicability for branches and tags\nin git-svn. It is now possible to use globs like 'a*e', or 'release_*'.\nThis allows users to avoid long lines in config like:\n\n        branches = branches/{release_20,release_21,release_22,...}\n\nIn favor of:\n\n        branches = branches/release_*\n\n[ew: amended commit message, minor formatting and style fixes]\n\nSigned-off-by: Victor Leschuk <vleschuk@accesssoftek.com>\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n\n\n\nI also noticed the \"Only one set of wildcard directories\" error\nmessage is unnecessary long and \"wildcard directories\" should\nprobably be shortened to \"wildcards\" to avoid wrapping in a terminal.\nThat will probably be a separate patch for me.\n"},{"id":"275953","messageId":"xmqqlh7tnwre.fsf@gitster.mtv.corp.google.com","threadId":"41162","inReplyTo":"20160113031601.GA28224@dcvr.yhbt.net","subject":"Re: [PATCH] git-svn: loosen config globs limitations","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-01-13T18:45:57Z","receivedAt":"2016-01-13T18:45:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> Thanks, I made a minor cleanup and applied with --whitespace=fix\n> to remove spaces from indentation.\n> ...\n> I also noticed the \"Only one set of wildcard directories\" error\n> message is unnecessary long and \"wildcard directories\" should\n> probably be shortened to \"wildcards\" to avoid wrapping in a terminal.\n> That will probably be a separate patch for me.\n\nShould I pull something from you now from 'master' at your\nbogomips.org repository?  I do not mind (and actually I would\nprefer) waiting until I hear a go ahead, which would let you work on\nyour own changes before I pull.\n\nThanks.\n"},{"id":"275963","messageId":"20160113192603.GA3638@dcvr.yhbt.net","threadId":"41162","inReplyTo":"xmqqlh7tnwre.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] git-svn: loosen config globs limitations","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2016-01-13T19:26:03Z","receivedAt":"2016-01-13T19:26:03Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> Eric Wong <normalperson@yhbt.net> writes:\n> > I also noticed the \"Only one set of wildcard directories\" error\n> > message is unnecessary long and \"wildcard directories\" should\n> > probably be shortened to \"wildcards\" to avoid wrapping in a terminal.\n> > That will probably be a separate patch for me.\n> \n> Should I pull something from you now from 'master' at your\n> bogomips.org repository?  I do not mind (and actually I would\n> prefer) waiting until I hear a go ahead, which would let you work on\n> your own changes before I pull.\n\nYes, please wait.  I'll fix the long messages later today.  Thanks\n"},{"id":"276004","messageId":"20160114040759.GA7671@dcvr.yhbt.net","threadId":"41162","inReplyTo":"20160113031601.GA28224@dcvr.yhbt.net","subject":"[PATCH] git-svn: shorten glob error message","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2016-01-14T04:07:59Z","receivedAt":"2016-01-14T04:07:59Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Error messages should attempt to fit within the confines of\nan 80-column terminal to avoid compatibility and accessibility\nproblems.  Furthermore the word \"directories\" can be misleading\nwhen used in the context of git refnames.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n  Eric Wong <normalperson@yhbt.net> wrote:\n  > I also noticed the \"Only one set of wildcard directories\" error\n  > message is unnecessary long and \"wildcard directories\" should\n  > probably be shortened to \"wildcards\" to avoid wrapping in a terminal.\n  > That will probably be a separate patch for me.\n\n  There's likely more instances of this in git-svn, but I figured\n  we'll get this one fixed, first.\n\n  Also pushed to bogomips.org/git-svn.git\n  (commit dc6aa7e61e9d33856f54d63b7acb518383420373)\n  along with Victor's patch.\n\n perl/Git/SVN/GlobSpec.pm                   | 4 ++--\n t/t9108-git-svn-glob.sh                    | 9 ++++++---\n t/t9109-git-svn-multi-glob.sh              | 9 ++++++---\n t/t9168-git-svn-partially-globbed-names.sh | 7 ++++---\n 4 files changed, 18 insertions(+), 11 deletions(-)\n\ndiff --git a/perl/Git/SVN/GlobSpec.pm b/perl/Git/SVN/GlobSpec.pm\nindex 4775026..a0a8d17 100644\n--- a/perl/Git/SVN/GlobSpec.pm\n+++ b/perl/Git/SVN/GlobSpec.pm\n@@ -8,8 +8,8 @@ sub new {\n \t$re =~ s!/+$!!g; # no need for trailing slashes\n \tmy (@left, @right, @patterns);\n \tmy $state = \"left\";\n-\tmy $die_msg = \"Only one set of wildcard directories \" .\n-\t\t\t\t\"(e.g. '*' or '*/*/*') is supported: '$glob'\\n\";\n+\tmy $die_msg = \"Only one set of wildcards \" .\n+\t\t\t\t\"(e.g. '*' or '*/*/*') is supported: $glob\\n\";\n \tfor my $part (split(m|/|, $glob)) {\n \t\tif ($pattern_ok && $part =~ /[{}]/ &&\n \t\t\t $part !~ /^\\{[^{}]+\\}/) {\ndiff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh\nindex d732d31..29b363b 100755\n--- a/t/t9108-git-svn-glob.sh\n+++ b/t/t9108-git-svn-glob.sh\n@@ -86,9 +86,12 @@ test_expect_success 'test left-hand-side only globbing' '\n \ttest_cmp expect.two output.two\n \t'\n \n-echo \"Only one set of wildcard directories\" \\\n-     \"(e.g. '*' or '*/*/*') is supported: 'branches/*/t/*'\" > expect.three\n-echo \"\" >> expect.three\n+test_expect_success 'prepare test disallow multi-globs' \"\n+cat >expect.three <<EOF\n+Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/*/t/*\n+\n+EOF\n+\t\"\n \n test_expect_success 'test disallow multi-globs' '\n \tgit config --add svn-remote.three.url \"$svnrepo\" &&\ndiff --git a/t/t9109-git-svn-multi-glob.sh b/t/t9109-git-svn-multi-glob.sh\nindex c318f9f..d0b79fe 100755\n--- a/t/t9109-git-svn-multi-glob.sh\n+++ b/t/t9109-git-svn-multi-glob.sh\n@@ -135,9 +135,12 @@ test_expect_success 'test another branch' '\n \ttest_cmp expect.four output.four\n \t'\n \n-echo \"Only one set of wildcard directories\" \\\n-     \"(e.g. '*' or '*/*/*') is supported: 'branches/*/t/*'\" > expect.three\n-echo \"\" >> expect.three\n+test_expect_success 'prepare test disallow multiple globs' \"\n+cat >expect.three <<EOF\n+Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/*/t/*\n+\n+EOF\n+\t\"\n \n test_expect_success 'test disallow multiple globs' '\n \tgit config --add svn-remote.three.url \"$svnrepo\" &&\ndiff --git a/t/t9168-git-svn-partially-globbed-names.sh b/t/t9168-git-svn-partially-globbed-names.sh\nindex a7641dc..8b22f22 100755\n--- a/t/t9168-git-svn-partially-globbed-names.sh\n+++ b/t/t9168-git-svn-partially-globbed-names.sh\n@@ -130,9 +130,10 @@ test_expect_success 'test prefixed globs match just prefix' '\n \t'\n \n test_expect_success 'prepare test disallow prefixed multi-globs' \"\n-\techo \\\"Only one set of wildcard directories\\\" \\\n-\t     \\\"(e.g. '*' or '*/*/*') is supported: 'branches/b_*/t/*'\\\" >expect.four &&\n-\techo \\\"\\\" >>expect.four\n+cat >expect.four <<EOF\n+Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/b_*/t/*\n+\n+EOF\n \t\"\n \n test_expect_success 'test disallow prefixed multi-globs' '\n-- \nEW\n"},{"id":"276062","messageId":"xmqqvb6wjacq.fsf@gitster.mtv.corp.google.com","threadId":"41162","inReplyTo":"20160114040759.GA7671@dcvr.yhbt.net","subject":"Re: [PATCH] git-svn: shorten glob error message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-01-14T18:15:49Z","receivedAt":"2016-01-14T18:15:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> Error messages should attempt to fit within the confines of\n> an 80-column terminal to avoid compatibility and accessibility\n> problems.  Furthermore the word \"directories\" can be misleading\n> when used in the context of git refnames.\n>\n> Signed-off-by: Eric Wong <normalperson@yhbt.net>\n> ---\n>   Eric Wong <normalperson@yhbt.net> wrote:\n>   > I also noticed the \"Only one set of wildcard directories\" error\n>   > message is unnecessary long and \"wildcard directories\" should\n>   > probably be shortened to \"wildcards\" to avoid wrapping in a terminal.\n>   > That will probably be a separate patch for me.\n>\n>   There's likely more instances of this in git-svn, but I figured\n>   we'll get this one fixed, first.\n>\n>   Also pushed to bogomips.org/git-svn.git\n>   (commit dc6aa7e61e9d33856f54d63b7acb518383420373)\n>   along with Victor's patch.\n\nThanks.\n\nI am not sure if it is a good idea to show */*/* as an example in\nthe message (that is an anti-example of 'one set of wildcard' by\nhaving three stars, isn't it?), but that is not a new issue this\nchange introduces.\n\n>  \tmy $state = \"left\";\n> -\tmy $die_msg = \"Only one set of wildcard directories \" .\n> -\t\t\t\t\"(e.g. '*' or '*/*/*') is supported: '$glob'\\n\";\n> +\tmy $die_msg = \"Only one set of wildcards \" .\n> +\t\t\t\t\"(e.g. '*' or '*/*/*') is supported: $glob\\n\";\n>  \tfor my $part (split(m|/|, $glob)) {\n>  \t\tif ($pattern_ok && $part =~ /[{}]/ &&\n>  \t\t\t $part !~ /^\\{[^{}]+\\}/) {\n> diff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh\n> index d732d31..29b363b 100755\n> --- a/t/t9108-git-svn-glob.sh\n> +++ b/t/t9108-git-svn-glob.sh\n> @@ -86,9 +86,12 @@ test_expect_success 'test left-hand-side only globbing' '\n>  \ttest_cmp expect.two output.two\n>  \t'\n>  \n> -echo \"Only one set of wildcard directories\" \\\n> -     \"(e.g. '*' or '*/*/*') is supported: 'branches/*/t/*'\" > expect.three\n> -echo \"\" >> expect.three\n> +test_expect_success 'prepare test disallow multi-globs' \"\n> +cat >expect.three <<EOF\n> +Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/*/t/*\n> +\n> +EOF\n> +\t\"\n>  \n>  test_expect_success 'test disallow multi-globs' '\n>  \tgit config --add svn-remote.three.url \"$svnrepo\" &&\n> diff --git a/t/t9109-git-svn-multi-glob.sh b/t/t9109-git-svn-multi-glob.sh\n> index c318f9f..d0b79fe 100755\n> --- a/t/t9109-git-svn-multi-glob.sh\n> +++ b/t/t9109-git-svn-multi-glob.sh\n> @@ -135,9 +135,12 @@ test_expect_success 'test another branch' '\n>  \ttest_cmp expect.four output.four\n>  \t'\n>  \n> -echo \"Only one set of wildcard directories\" \\\n> -     \"(e.g. '*' or '*/*/*') is supported: 'branches/*/t/*'\" > expect.three\n> -echo \"\" >> expect.three\n> +test_expect_success 'prepare test disallow multiple globs' \"\n> +cat >expect.three <<EOF\n> +Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/*/t/*\n> +\n> +EOF\n> +\t\"\n>  \n>  test_expect_success 'test disallow multiple globs' '\n>  \tgit config --add svn-remote.three.url \"$svnrepo\" &&\n> diff --git a/t/t9168-git-svn-partially-globbed-names.sh b/t/t9168-git-svn-partially-globbed-names.sh\n> index a7641dc..8b22f22 100755\n> --- a/t/t9168-git-svn-partially-globbed-names.sh\n> +++ b/t/t9168-git-svn-partially-globbed-names.sh\n> @@ -130,9 +130,10 @@ test_expect_success 'test prefixed globs match just prefix' '\n>  \t'\n>  \n>  test_expect_success 'prepare test disallow prefixed multi-globs' \"\n> -\techo \\\"Only one set of wildcard directories\\\" \\\n> -\t     \\\"(e.g. '*' or '*/*/*') is supported: 'branches/b_*/t/*'\\\" >expect.four &&\n> -\techo \\\"\\\" >>expect.four\n> +cat >expect.four <<EOF\n> +Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/b_*/t/*\n> +\n> +EOF\n>  \t\"\n>  \n>  test_expect_success 'test disallow prefixed multi-globs' '\n"},{"id":"276540","messageId":"1453478851657.1340@accesssoftek.com","threadId":"41162","inReplyTo":"xmqqvb6wjacq.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] git-svn: shorten glob error message","fromName":"Victor Leschuk","fromEmail":"vleschuk@accesssoftek.com","sentAt":"2016-01-22T16:07:32Z","receivedAt":"2016-01-22T16:07:32Z","isPatch":true,"sender":{"key":"vleschuk@accesssoftek.com","avatar":null},"body":"Hello all,\n\nOn 01/14/2016 09:15 PM, Junio C Hamano wrote:\n> Eric Wong <normalperson@yhbt.net> writes:\n>\n>> Error messages should attempt to fit within the confines of\n>> an 80-column terminal to avoid compatibility and accessibility\n>> problems.  Furthermore the word \"directories\" can be misleading\n>> when used in the context of git refnames.\n>>\n>> Signed-off-by: Eric Wong <normalperson@yhbt.net>\n>> ---\n>>    Eric Wong <normalperson@yhbt.net> wrote:\n>>    > I also noticed the \"Only one set of wildcard directories\" error\n>>    > message is unnecessary long and \"wildcard directories\" should\n>>    > probably be shortened to \"wildcards\" to avoid wrapping in a terminal.\n>>    > That will probably be a separate patch for me.\n>>\n>>    There's likely more instances of this in git-svn, but I figured\n>>    we'll get this one fixed, first.\n>>\n>>    Also pushed to bogomips.org/git-svn.git\n>>    (commit dc6aa7e61e9d33856f54d63b7acb518383420373)\n>>    along with Victor's patch.\n> Thanks.\n>\n> I am not sure if it is a good idea to show */*/* as an example in\n> the message (that is an anti-example of 'one set of wildcard' by\n> having three stars, isn't it?), but that is not a new issue this\n> change introduces.\n\nI agree, this should be changed, however I think this should be done in \nseparate patch.\n\nDo we have any questions left open before this could be merged into main \ngit repo?\n\n--\nVictor\n"},{"id":"276846","messageId":"20160127025408.GA17600@dcvr.yhbt.net","threadId":"41162","inReplyTo":"xmqqvb6wjacq.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] git-svn: shorten glob error message","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2016-01-27T02:54:08Z","receivedAt":"2016-01-27T02:54:08Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> I am not sure if it is a good idea to show */*/* as an example in\n> the message (that is an anti-example of 'one set of wildcard' by\n> having three stars, isn't it?), but that is not a new issue this\n> change introduces.\n\nActually, going back to commit 570d35c26dfbc40757da6032cdc96afb58cc0037\n(\"git-svn: Allow deep branch names by supporting multi-globs\"),\nhaving equal '*' on both sides is all that is required.\n\nNot sure how to improve the wording, though...\n\n> >  \tmy $state = \"left\";\n> > -\tmy $die_msg = \"Only one set of wildcard directories \" .\n> > -\t\t\t\t\"(e.g. '*' or '*/*/*') is supported: '$glob'\\n\";\n> > +\tmy $die_msg = \"Only one set of wildcards \" .\n> > +\t\t\t\t\"(e.g. '*' or '*/*/*') is supported: $glob\\n\";\n> >  \tfor my $part (split(m|/|, $glob)) {\n> >  \t\tif ($pattern_ok && $part =~ /[{}]/ &&\n> >  \t\t\t $part !~ /^\\{[^{}]+\\}/) {\n"},{"id":"276933","messageId":"xmqqr3h27oqr.fsf@gitster.mtv.corp.google.com","threadId":"41162","inReplyTo":"20160127025408.GA17600@dcvr.yhbt.net","subject":"Re: [PATCH] git-svn: shorten glob error message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-01-27T20:26:36Z","receivedAt":"2016-01-27T20:26:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> Junio C Hamano <gitster@pobox.com> wrote:\n>> I am not sure if it is a good idea to show */*/* as an example in\n>> the message (that is an anti-example of 'one set of wildcard' by\n>> having three stars, isn't it?), but that is not a new issue this\n>> change introduces.\n>\n> Actually, going back to commit 570d35c26dfbc40757da6032cdc96afb58cc0037\n> (\"git-svn: Allow deep branch names by supporting multi-globs\"),\n> having equal '*' on both sides is all that is required.\n>\n> Not sure how to improve the wording, though...\n\nI dunno, either, and that is why \"not a new issue\", iow, the patch\nis good as-is.  The wording might be an area with possible future\nimprovement, but that does not have to block the improvement the\npatch under discussion brings us.\n\nThanks.\n"}]}