{"thread":{"id":"40404","subject":"git-svn aborts with \"Use of uninitialized value $u\" when a non-svn-backed branch is present in remote","startedAt":"2015-09-22T18:48:41Z","lastAt":"2016-07-02T10:43:01Z","messageCount":6,"participants":["Jacob Godserv","Eric Wong","Christian Couder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"270510","messageId":"CALi1mtc8zmOzk-qv4XAg6N=ENasnMAENdJSLHK7EcpxRUk1nTw@mail.gmail.com","threadId":"40404","inReplyTo":null,"subject":"git-svn aborts with \"Use of uninitialized value $u\" when a non-svn-backed branch is present in remote","fromName":"Jacob Godserv","fromEmail":"jacobgodserv@gmail.com","sentAt":"2015-09-22T18:48:41Z","receivedAt":"2015-09-22T18:48:41Z","isPatch":false,"sender":{"key":"jacobgodserv@gmail.com","avatar":null},"body":"I found a specific case in which git-svn improperly aborts:\n\n1. I created a git-svn repository, named \"git-svn repo\", by cloned an\nsvn repository via the git-svn tool.\n2. I created a normal git repository, named \"configuration repo\". I\nrenamed the master branch to \"configuration\". The initial commit adds\na README and some utility scripts.\n3. I created a bare repository, named \"master repo\".\n4. I pushed from the git-svn repo to the master repo.\n5. I pushed from the configuration repo to the master repo.\n\nThe idea is the configuration branch, which is detached from any\ngit-svn history, can contain some useful tools, defaults, etc., that I\ncan share with teammates who want to use git on this svn project. It's\nan odd use of git, but it has been working well.\n\nHowever, a vanilla distribution of Git for Windows 2.5.2 produces the\nfollowing error when running any git-svn command, such as \"git svn\ninfo\", on the cloned master repo:\n\nUse of uninitialized value $u in substitution (s///) at\n/mingw64/share/perl5/site_perl/Git/SVN.pm line 105.\nUse of uninitialized value $u in concatenation (.) or string at\n/mingw64/share/perl5/site_perl/Git/SVN.pm line 105.\nrefs/remotes/origin/configuration: 'svn+ssh://10.0.1.1/repos/projectA'\nnot found in ''\n\nIn the mentioned SVN.pm file, after the line:\n\n                        my $u = (::cmt_metadata(\"$refname\"))[0];\n\nI added the following four lines:\n\n                        if (not defined $u) {\n                                warn \"W: $refname does not exist in\nSVN; skipping\";\n                                next;\n                        }\n\ngit-svn appears to operate correctly with this patch. This is my first\ntime ever editing a perl script, so I apologize if I murdered an\nadorable animal just now.\n\nI'm sending this in so more knowledgeable git-svn developers can\ncomment on this and fix this in the official distribution of git,\nassuming there is a bug here to fix.\n\n-- \n    Jacob\n"},{"id":"290021","messageId":"CALi1mtdtNF_GtzyPTbfb7N51wwxsFY7zm8hsgwxr3tHcZZboyg@mail.gmail.com","threadId":"40404","inReplyTo":"CALi1mtc8zmOzk-qv4XAg6N=ENasnMAENdJSLHK7EcpxRUk1nTw@mail.gmail.com","subject":"Re: git-svn aborts with \"Use of uninitialized value $u\" when a non-svn-backed branch is present in remote","fromName":"Jacob Godserv","fromEmail":"jacobgodserv@gmail.com","sentAt":"2016-06-24T14:44:05Z","receivedAt":"2016-06-24T14:44:11Z","isPatch":false,"sender":{"key":"jacobgodserv@gmail.com","avatar":null},"body":"On Tue, Sep 22, 2015 at 2:48 PM, Jacob Godserv <jacobgodserv@gmail.com> wrote:\n> I found a specific case in which git-svn improperly aborts:\n>\n> 1. I created a git-svn repository, named \"git-svn repo\", by cloned an\n> svn repository via the git-svn tool.\n> 2. I created a normal git repository, named \"configuration repo\". I\n> renamed the master branch to \"configuration\". The initial commit adds\n> a README and some utility scripts.\n> 3. I created a bare repository, named \"master repo\".\n> 4. I pushed from the git-svn repo to the master repo.\n> 5. I pushed from the configuration repo to the master repo.\n>\n> The idea is the configuration branch, which is detached from any\n> git-svn history, can contain some useful tools, defaults, etc., that I\n> can share with teammates who want to use git on this svn project. It's\n> an odd use of git, but it has been working well.\n>\n> However, a vanilla distribution of Git for Windows 2.5.2 produces the\n> following error when running any git-svn command, such as \"git svn\n> info\", on the cloned master repo:\n>\n> Use of uninitialized value $u in substitution (s///) at\n> /mingw64/share/perl5/site_perl/Git/SVN.pm line 105.\n> Use of uninitialized value $u in concatenation (.) or string at\n> /mingw64/share/perl5/site_perl/Git/SVN.pm line 105.\n> refs/remotes/origin/configuration: 'svn+ssh://10.0.1.1/repos/projectA'\n> not found in ''\n>\n> In the mentioned SVN.pm file, after the line:\n>\n>                         my $u = (::cmt_metadata(\"$refname\"))[0];\n>\n> I added the following four lines:\n>\n>                         if (not defined $u) {\n>                                 warn \"W: $refname does not exist in\n> SVN; skipping\";\n>                                 next;\n>                         }\n>\n> git-svn appears to operate correctly with this patch. This is my first\n> time ever editing a perl script, so I apologize if I murdered an\n> adorable animal just now.\n>\n> I'm sending this in so more knowledgeable git-svn developers can\n> comment on this and fix this in the official distribution of git,\n> assuming there is a bug here to fix.\n>\n> --\n>     Jacob\n\nThis e-mail has gone ignored several months. Is the maintainer of\ngit-svn on this mailing list? Should I submit this issue elsewhere?\n\n-- \n    Jacob\n"},{"id":"290047","messageId":"20160624193548.GA22070@dcvr.yhbt.net","threadId":"40404","inReplyTo":"CALi1mtdtNF_GtzyPTbfb7N51wwxsFY7zm8hsgwxr3tHcZZboyg@mail.gmail.com","subject":"Re: git-svn aborts with \"Use of uninitialized value $u\" when a non-svn-backed branch is present in remote","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2016-06-24T19:35:48Z","receivedAt":"2016-06-24T19:35:51Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Jacob Godserv <jacobgodserv@gmail.com> wrote:\n> On Tue, Sep 22, 2015 at 2:48 PM, Jacob Godserv <jacobgodserv@gmail.com> wrote:\n> > I found a specific case in which git-svn improperly aborts:\n> >\n> > 1. I created a git-svn repository, named \"git-svn repo\", by cloned an\n> > svn repository via the git-svn tool.\n> > 2. I created a normal git repository, named \"configuration repo\". I\n> > renamed the master branch to \"configuration\". The initial commit adds\n> > a README and some utility scripts.\n> > 3. I created a bare repository, named \"master repo\".\n> > 4. I pushed from the git-svn repo to the master repo.\n> > 5. I pushed from the configuration repo to the master repo.\n> >\n> > The idea is the configuration branch, which is detached from any\n> > git-svn history, can contain some useful tools, defaults, etc., that I\n> > can share with teammates who want to use git on this svn project. It's\n> > an odd use of git, but it has been working well.\n> >\n> > However, a vanilla distribution of Git for Windows 2.5.2 produces the\n> > following error when running any git-svn command, such as \"git svn\n> > info\", on the cloned master repo:\n> >\n> > Use of uninitialized value $u in substitution (s///) at\n> > /mingw64/share/perl5/site_perl/Git/SVN.pm line 105.\n> > Use of uninitialized value $u in concatenation (.) or string at\n> > /mingw64/share/perl5/site_perl/Git/SVN.pm line 105.\n> > refs/remotes/origin/configuration: 'svn+ssh://10.0.1.1/repos/projectA'\n> > not found in ''\n> >\n> > In the mentioned SVN.pm file, after the line:\n> >\n> >                         my $u = (::cmt_metadata(\"$refname\"))[0];\n> >\n> > I added the following four lines:\n> >\n> >                         if (not defined $u) {\n> >                                 warn \"W: $refname does not exist in\n> > SVN; skipping\";\n> >                                 next;\n> >                         }\n\nChristian (Cc-ed) also noticed the problem a few weeks ago\nand took a more drastic approach by having git-svn die\ninstead of warning:\nhttp://mid.gmane.org/1462604323-18545-1-git-send-email-chriscool@tuxfamily.org\nwhich landed as commit 523a33ca17c76bee007d7394fb3930266c577c02\nin git.git: https://bogomips.org/mirrors/git.git/patch?id=523a33ca17c7\n\nIs dying here too drastic and maybe warn is preferable?\n\n> > git-svn appears to operate correctly with this patch. This is my first\n> > time ever editing a perl script, so I apologize if I murdered an\n> > adorable animal just now.\n> >\n> > I'm sending this in so more knowledgeable git-svn developers can\n> > comment on this and fix this in the official distribution of git,\n> > assuming there is a bug here to fix.\n> >\n> > --\n> >     Jacob\n> \n> This e-mail has gone ignored several months. Is the maintainer of\n> git-svn on this mailing list? Should I submit this issue elsewhere?\n\nSorry, I wasn't paying attention to the list at that time.\nIt is customary to Cc: authors of the code in question\n(that also decentralizes our workflow in case vger is down),\nand also acceptable to send reminders after a week or two\nin case we're overloaded with other work.\n"},{"id":"290058","messageId":"20160624200603.GA28498@dcvr.yhbt.net","threadId":"40404","inReplyTo":"CALi1mtc6Byb39kbAv16vmkUVu3JDdGG4-yVrLroDVraPDxGFng@mail.gmail.com","subject":"Re: git-svn aborts with \"Use of uninitialized value $u\" when a non-svn-backed branch is present in remote","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2016-06-24T20:06:03Z","receivedAt":"2016-06-24T20:06:09Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Please don't drop Cc:, re-adding git@vger and Christian\n\nJacob Godserv <jacobgodserv@gmail.com> wrote:\n> > Christian (Cc-ed) also noticed the problem a few weeks ago\n> > and took a more drastic approach by having git-svn die\n> > instead of warning:\n> > http://mid.gmane.org/1462604323-18545-1-git-send-email-chriscool@tuxfamily.org\n> > which landed as commit 523a33ca17c76bee007d7394fb3930266c577c02\n> > in git.git: https://bogomips.org/mirrors/git.git/patch?id=523a33ca17c7\n> >\n> > Is dying here too drastic and maybe warn is preferable?\n> \n> In my opinion this is too drastic. It keeps me from storing\n> git-specific data on a git-svn mirror.\n\nI tend to agree, but will wait to see what Christian thinks.\n\n> Here's my setup:\n>  - My git-svn mirror uses git-svn to create a git repo that mirrors\n> svn history. This repository is then pushed to a clean bare\n> repository. So far so good. Only svn-sourced branches exist.\n>  - The git-svn mirror script also saves a copy of the git-svn\n> configuration used to generate the git mirror repository in an\n> \"orphaned\" branch called something like 'git-svn-conf'. This is\n> completely separate from the svn history, and exists only for my\n> git-svn purposes.\n>  - On the \"client\" side, another script I wrote knows how to parse the\n> git-svn configuration in that 'git-svn-conf' branch to properly\n> reconfigure git-svn on the local machine, so I can use 'git svn'\n> themselves to commit, etc., and still generate the same hashes so\n> there's no forked history during the next mirror fetch.\n> \n> Long story short: I have branches which aren't in SVN history for\n> automated git-svn purposes.\n> \n> It appears that simply skipping the branch in that loop fixes the\n> issue. However, I don't know how the metadata is stored and what\n> exactly that loop does, so I may be creating hidden side effects I\n> have been lucky enough to not trigger yet.\n"},{"id":"290129","messageId":"CAP8UFD0+vG3i26=w7WqjYcpOLj+V6X35_W6DAiMmTpiC2kxRWA@mail.gmail.com","threadId":"40404","inReplyTo":"20160624200603.GA28498@dcvr.yhbt.net","subject":"Re: git-svn aborts with \"Use of uninitialized value $u\" when a non-svn-backed branch is present in remote","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2016-06-25T08:39:30Z","receivedAt":"2016-06-25T08:39:49Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Fri, Jun 24, 2016 at 10:06 PM, Eric Wong <e@80x24.org> wrote:\n> Please don't drop Cc:, re-adding git@vger and Christian\n>\n> Jacob Godserv <jacobgodserv@gmail.com> wrote:\n>> > Christian (Cc-ed) also noticed the problem a few weeks ago\n>> > and took a more drastic approach by having git-svn die\n>> > instead of warning:\n>> > http://mid.gmane.org/1462604323-18545-1-git-send-email-chriscool@tuxfamily.org\n>> > which landed as commit 523a33ca17c76bee007d7394fb3930266c577c02\n>> > in git.git: https://bogomips.org/mirrors/git.git/patch?id=523a33ca17c7\n>> >\n>> > Is dying here too drastic and maybe warn is preferable?\n>>\n>> In my opinion this is too drastic. It keeps me from storing\n>> git-specific data on a git-svn mirror.\n>\n> I tend to agree, but will wait to see what Christian thinks.\n\nYeah a warning is probably enough.\nAnother possibility would be to default to an error that tells people\nabout a configuration variable that could let them decide depending on\ntheir workflow if this should be an error, a warning or just be\nignored.\n"},{"id":"290744","messageId":"20160702103317.GA6120@dcvr.yhbt.net","threadId":"40404","inReplyTo":"CAP8UFD0+vG3i26=w7WqjYcpOLj+V6X35_W6DAiMmTpiC2kxRWA@mail.gmail.com","subject":"[PATCH] git-svn: warn instead of dying when commit data is missing","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2016-07-02T10:33:18Z","receivedAt":"2016-07-02T10:43:01Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Christian Couder <christian.couder@gmail.com> wrote:\n> On Fri, Jun 24, 2016 at 10:06 PM, Eric Wong <e@80x24.org> wrote:\n> > Jacob Godserv <jacobgodserv@gmail.com> wrote:\n> >> > Christian (Cc-ed) also noticed the problem a few weeks ago\n> >> > and took a more drastic approach by having git-svn die\n> >> > instead of warning:\n> >> > http://mid.gmane.org/1462604323-18545-1-git-send-email-chriscool@tuxfamily.org\n> >> > which landed as commit 523a33ca17c76bee007d7394fb3930266c577c02\n> >> > in git.git: https://bogomips.org/mirrors/git.git/patch?id=523a33ca17c7\n> >> >\n> >> > Is dying here too drastic and maybe warn is preferable?\n> >>\n> >> In my opinion this is too drastic. It keeps me from storing\n> >> git-specific data on a git-svn mirror.\n> >\n> > I tend to agree, but will wait to see what Christian thinks.\n> \n> Yeah a warning is probably enough.\n\nOK, patch below.\n\n> Another possibility would be to default to an error that tells people\n> about a configuration variable that could let them decide depending on\n> their workflow if this should be an error, a warning or just be\n> ignored.\n\nI think that's too much.  I'm not a fan of having too many\nconfiguration variables to throw on users.\n\n------8<------\nSubject: [PATCH] git-svn: warn instead of dying when commit data is missing\n\nIt is possible to have refs globbed by git-svn which stores data\npurely in git; gently skip those instead of dying and assuming\nuser error.\n\nref: http://mid.gmane.org/CALi1mtdtNF_GtzyPTbfb7N51wwxsFY7zm8hsgwxr3tHcZZboyg@mail.gmail.com\n\nSuggested-by: Jacob Godserv <jacobgodserv@gmail.com>\nCc: Christian Couder <chriscool@tuxfamily.org>\nSigned-off-by: Eric Wong <e@80x24.org>\n---\n perl/Git/SVN.pm | 8 ++++++--\n 1 file changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm\nindex bee1e7d..018beb8 100644\n--- a/perl/Git/SVN.pm\n+++ b/perl/Git/SVN.pm\n@@ -97,8 +97,12 @@ sub resolve_local_globs {\n \t\t\t\t    \"existing: $existing\\n\",\n \t\t\t\t    \" globbed: $refname\\n\";\n \t\t\t}\n-\t\t\tmy $u = (::cmt_metadata(\"$refname\"))[0] or die\n-\t\t\t    \"$refname: no associated commit metadata\\n\";\n+\t\t\tmy $u = (::cmt_metadata(\"$refname\"))[0];\n+\t\t\tif (!defined($u)) {\n+\t\t\t\twarn\n+\"W: $refname: no associated commit metadata from SVN, skipping\\n\";\n+\t\t\t\tnext;\n+\t\t\t}\n \t\t\t$u =~ s!^\\Q$url\\E(/|$)!! or die\n \t\t\t  \"$refname: '$url' not found in '$u'\\n\";\n \t\t\tif ($pathname ne $u) {\n-- \nEW\n"}]}