{"thread":{"id":"20797","subject":"how to skip branches on git svn clone/fetch when there are errors","startedAt":"2009-08-31T08:26:36Z","lastAt":"2009-09-07T17:55:40Z","messageCount":9,"participants":["Daniele Segato","Eric Wong","Paolo Ciarrocchi"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"122176","messageId":"9accb4400908310126v15b08c7fr425c9daff26012f3@mail.gmail.com","threadId":"20797","inReplyTo":null,"subject":"how to skip branches on git svn clone/fetch when there are errors","fromName":"Daniele Segato","fromEmail":"daniele.bilug@gmail.com","sentAt":"2009-08-31T08:26:36Z","receivedAt":"2009-08-31T08:26:36Z","isPatch":false,"sender":{"key":"daniele.bilug@gmail.com","avatar":null},"body":"Hi,\n\nI'm trying to clone a big repository.\n\nI follow this steps:\n\ngit init\ngit svn init svn://svn.mydomain.com/path/to/repo -T HEAD -b BRANCHES -t TAGS\n\nvim .git/config # edited the svn-remote config as follow (add /root to\nbranches and tag) to match the repo structure\n[svn-remote \"svn\"]\n       url = svn://svn.mydomain.com\n       fetch = path/to/repo/HEAD/root:refs/remotes/svn/trunk\n       branches = path/to/repo/BRANCHES/*/root:refs/remotes/svn/*\n       tags = path/to/repo/TAGS/*/root:refs/remotes/svn/tags/*\n\ngit svn fetch\n\nWhen I reach revision ~7500 (I don't remember the exact number) I get an error:\n\n$ git svn fetch\nUse of uninitialized value in concatenation (.) or string at\n/usr/lib/perl5/SVN/Core.pm line 584.\nAuthorization failed:  at /usr/bin/git-svn line 1415\n\n\nAfter some debugging I found out the reason is something strange on\nthe SVN server: there is a folder in the SVN that give an error when\ntrying to access:\n\n$ svn info svn://svn.mydomain.com/path/to/repo/BRANCHES/V2.1-A\nsvn: Authorization failed\n\nThe same error with svn list.\n\nI don't know what's wrong with that branch but I just want to skip it...\n\nI tried modifying the .git/config svn-remote configuration adding this:\n\nignore-paths = path\\\\/to\\\\/repo\\\\/BRANCHES\\\\/V2\\\\.1-A\n\nand re-launching git svn fetch.\n\nI had no luck.\n\nHo do I skip a path on the svn repository?\n\n(I can't provide the real svn repo because it is password protected\nand I can't give you the access)\n\nThanks,\nRegards,\nDaniele\n"},{"id":"122481","messageId":"20090905061657.GC22272@dcvr.yhbt.net","threadId":"20797","inReplyTo":"9accb4400908310126v15b08c7fr425c9daff26012f3@mail.gmail.com","subject":"Re: how to skip branches on git svn clone/fetch when there are errors","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-09-05T06:16:57Z","receivedAt":"2009-09-05T06:16:57Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Daniele Segato <daniele.bilug@gmail.com> wrote:\n> Hi,\n> \n> I'm trying to clone a big repository.\n> \n> I follow this steps:\n> \n> git init\n> git svn init svn://svn.mydomain.com/path/to/repo -T HEAD -b BRANCHES -t TAGS\n> \n> vim .git/config # edited the svn-remote config as follow (add /root to\n> branches and tag) to match the repo structure\n> [svn-remote \"svn\"]\n>        url = svn://svn.mydomain.com\n>        fetch = path/to/repo/HEAD/root:refs/remotes/svn/trunk\n>        branches = path/to/repo/BRANCHES/*/root:refs/remotes/svn/*\n>        tags = path/to/repo/TAGS/*/root:refs/remotes/svn/tags/*\n> \n> git svn fetch\n> \n> When I reach revision ~7500 (I don't remember the exact number) I get an error:\n> \n> $ git svn fetch\n> Use of uninitialized value in concatenation (.) or string at\n> /usr/lib/perl5/SVN/Core.pm line 584.\n> Authorization failed:  at /usr/bin/git-svn line 1415\n> \n> \n> After some debugging I found out the reason is something strange on\n> the SVN server: there is a folder in the SVN that give an error when\n> trying to access:\n> \n> $ svn info svn://svn.mydomain.com/path/to/repo/BRANCHES/V2.1-A\n> svn: Authorization failed\n> \n> The same error with svn list.\n> \n> I don't know what's wrong with that branch but I just want to skip it...\n\nOuch :(\n\n> I tried modifying the .git/config svn-remote configuration adding this:\n> \n> ignore-paths = path\\\\/to\\\\/repo\\\\/BRANCHES\\\\/V2\\\\.1-A\n\n> and re-launching git svn fetch.\n\nignore-paths is only for paths that get converted into part of\nthe git tree\n\n> I had no luck.\n> \n> Ho do I skip a path on the svn repository?\n\nIt's unfortunate, but there's not yet an exclude/ignore directive\nwhen globbing.  You'll have to change your $GIT_CONFIG to only\nhave a list of branches you want, something like this:\n\n[svn-remote \"svn\"]\n\turl = svn://svn.mydomain.com\n\tfetch = path/to/repo/HEAD/root:refs/remotes/svn/trunk\n\n\t; have one \"fetch\" line for every branch except the one you want\n\tfetch = path/to/repo/BRANCHES/a/root:refs/remotes/svn/a\n\tfetch = path/to/repo/BRANCHES/b/root:refs/remotes/svn/b\n\tfetch = path/to/repo/BRANCHES/c/root:refs/remotes/svn/c\n\n\t; you can do the same for tags if you have the same problem\n\ttags = path/to/repo/TAGS/*/root:refs/remotes/svn/tags/*\n\nBut you shouldn't have to worry about having \"fetch\" entries for\nstale/old branches/tags you've already imported.\n\n-- \nEric Wong\n"},{"id":"122505","messageId":"1252140904.8992.6.camel@localhost","threadId":"20797","inReplyTo":"20090905061657.GC22272@dcvr.yhbt.net","subject":"Re: how to skip branches on git svn clone/fetch when there are errors","fromName":"Daniele Segato","fromEmail":"daniele.bilug@gmail.com","sentAt":"2009-09-05T08:55:04Z","receivedAt":"2009-09-05T08:55:04Z","isPatch":false,"sender":{"key":"daniele.bilug@gmail.com","avatar":null},"body":"Il giorno ven, 04/09/2009 alle 23.16 -0700, Eric Wong ha scritto:\n> It's unfortunate, but there's not yet an exclude/ignore directive\n> when globbing.  You'll have to change your $GIT_CONFIG to only\n> have a list of branches you want, something like this:\n> \n> [svn-remote \"svn\"]\n> \turl = svn://svn.mydomain.com\n> \tfetch = path/to/repo/HEAD/root:refs/remotes/svn/trunk\n> \n> \t; have one \"fetch\" line for every branch except the one you want\n> \tfetch = path/to/repo/BRANCHES/a/root:refs/remotes/svn/a\n> \tfetch = path/to/repo/BRANCHES/b/root:refs/remotes/svn/b\n> \tfetch = path/to/repo/BRANCHES/c/root:refs/remotes/svn/c\n> \n> \t; you can do the same for tags if you have the same problem\n> \ttags = path/to/repo/TAGS/*/root:refs/remotes/svn/tags/*\n> \n> But you shouldn't have to worry about having \"fetch\" entries for\n> stale/old branches/tags you've already imported.\n\nI see...\nThat means that then I'll have to manually add new created branches,\nright?\n\nwell... I tried to avoid this kind of configuration for weeks :) but\nthat's probably my best way with that repo....\n\nthank you,\nDaniele\n"},{"id":"122532","messageId":"20090906014837.GD28829@dcvr.yhbt.net","threadId":"20797","inReplyTo":"1252140904.8992.6.camel@localhost","subject":"Re: how to skip branches on git svn clone/fetch when there are errors","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-09-06T01:48:38Z","receivedAt":"2009-09-06T01:48:38Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Daniele Segato <daniele.bilug@gmail.com> wrote:\n> Il giorno ven, 04/09/2009 alle 23.16 -0700, Eric Wong ha scritto:\n> > It's unfortunate, but there's not yet an exclude/ignore directive\n> > when globbing.  You'll have to change your $GIT_CONFIG to only\n> > have a list of branches you want, something like this:\n> > \n> > [svn-remote \"svn\"]\n> > \turl = svn://svn.mydomain.com\n> > \tfetch = path/to/repo/HEAD/root:refs/remotes/svn/trunk\n> > \n> > \t; have one \"fetch\" line for every branch except the one you want\n> > \tfetch = path/to/repo/BRANCHES/a/root:refs/remotes/svn/a\n> > \tfetch = path/to/repo/BRANCHES/b/root:refs/remotes/svn/b\n> > \tfetch = path/to/repo/BRANCHES/c/root:refs/remotes/svn/c\n> > \n> > \t; you can do the same for tags if you have the same problem\n> > \ttags = path/to/repo/TAGS/*/root:refs/remotes/svn/tags/*\n> > \n> > But you shouldn't have to worry about having \"fetch\" entries for\n> > stale/old branches/tags you've already imported.\n> \n> I see...\n> That means that then I'll have to manually add new created branches,\n> right?\n\nYes.\n\n-- \nEric Wong\n"},{"id":"122611","messageId":"9accb4400909070230n413c6ecfqef8238422dd5d3b@mail.gmail.com","threadId":"20797","inReplyTo":"9accb4400908310126v15b08c7fr425c9daff26012f3@mail.gmail.com","subject":"Re: how to skip branches on git svn clone/fetch when there are errors","fromName":"Daniele Segato","fromEmail":"daniele.bilug@gmail.com","sentAt":"2009-09-07T09:30:58Z","receivedAt":"2009-09-07T09:30:58Z","isPatch":false,"sender":{"key":"daniele.bilug@gmail.com","avatar":null},"body":"On Mon, Aug 31, 2009 at 10:26 AM, Daniele\nSegato<daniele.bilug@gmail.com> wrote:>\n> git init\n> git svn init svn://svn.mydomain.com/path/to/repo -T HEAD -b BRANCHES -t TAGS\n> $ git svn fetch\n> Use of uninitialized value in concatenation (.) or string at\n> /usr/lib/perl5/SVN/Core.pm line 584.\n> Authorization failed:  at /usr/bin/git-svn line 1415\n>\n\nmore info on the error (enabled the confess instead of croak to the\nCore.pm library)\n\nUse of uninitialized value in concatenation (.) or string at\n/usr/lib/perl5/SVN/Core.pm line 585.\nAuthorization failed:  at /usr/lib/perl5/SVN/Core.pm line 654\n\tSVN::Error::confess_on_error('_p_svn_error_t=SCALAR(0x9492a50)')\ncalled at /usr/lib/perl5/SVN/Ra.pm line 492\n\tSVN::Ra::AUTOLOAD('Git::SVN::Ra=HASH(0x945dae8)',\n'alfresco-enterprise-mirror/alfresco/BRANCHES/V2.1-A/root', 7738,\n'SVN::Pool=REF(0x9492bc0)') called at /usr/bin/git-svn line 3760\n\tGit::SVN::Ra::check_path('Git::SVN::Ra=HASH(0x945dae8)',\n'alfresco-enterprise-mirror/alfresco/BRANCHES/V2.1-A/root', 7738)\ncalled at /usr/bin/git-svn line 4045\n\tGit::SVN::Ra::get_dir_check('Git::SVN::Ra=HASH(0x945dae8)',\n'HASH(0x92131e0)', 'HASH(0x9388050)', 7738) called at /usr/bin/git-svn\nline 4062\n\tGit::SVN::Ra::match_globs('Git::SVN::Ra=HASH(0x945dae8)',\n'HASH(0x92131e0)', 'HASH(0x9463c00)', 'ARRAY(0x90bbc00)', 7738) called\nat /usr/bin/git-svn line 3985\n\tGit::SVN::Ra::gs_fetch_loop_common('Git::SVN::Ra=HASH(0x945dae8)',\n7737, 16113, 'ARRAY(0x90bbbe0)', 'ARRAY(0x90bbc00)') called at\n/usr/bin/git-svn line 1415\n\tGit::SVN::fetch_all('svn', 'HASH(0x9464250)') called at\n/usr/bin/git-svn line 372\n\tmain::cmd_fetch() called at /usr/bin/git-svn line 253\n\teval {...} called at /usr/bin/git-svn line 251\n\n\nI'll keep looking at it to see if I can figure out a way to \"skip\" the\nerror myself and, eventually, provide a patch\n\nBye,\nDaniele\n"},{"id":"122629","messageId":"9accb4400909070634oee46b78g9270586a2b0eb4b9@mail.gmail.com","threadId":"20797","inReplyTo":"9accb4400909070230n413c6ecfqef8238422dd5d3b@mail.gmail.com","subject":"Re: how to skip branches on git svn clone/fetch when there are errors","fromName":"Daniele Segato","fromEmail":"daniele.bilug@gmail.com","sentAt":"2009-09-07T13:34:28Z","receivedAt":"2009-09-07T13:34:28Z","isPatch":false,"sender":{"key":"daniele.bilug@gmail.com","avatar":null},"body":"On Mon, Sep 7, 2009 at 11:30 AM, Daniele Segato<daniele.bilug@gmail.com> wrote:\n> more info on the error (enabled the confess instead of croak to the\n> Core.pm library)\n>\n> Use of uninitialized value in concatenation (.) or string at\n> /usr/lib/perl5/SVN/Core.pm line 585.\n> Authorization failed:  at /usr/lib/perl5/SVN/Core.pm line 654\n>        SVN::Error::confess_on_error('_p_svn_error_t=SCALAR(0x9492a50)')\n> called at /usr/lib/perl5/SVN/Ra.pm line 492\n>        SVN::Ra::AUTOLOAD('Git::SVN::Ra=HASH(0x945dae8)',\n> 'alfresco-enterprise-mirror/alfresco/BRANCHES/V2.1-A/root', 7738,\n> 'SVN::Pool=REF(0x9492bc0)') called at /usr/bin/git-svn line 3760\n>        Git::SVN::Ra::check_path('Git::SVN::Ra=HASH(0x945dae8)',\n> 'alfresco-enterprise-mirror/alfresco/BRANCHES/V2.1-A/root', 7738)\n> called at /usr/bin/git-svn line 4045\n>        Git::SVN::Ra::get_dir_check('Git::SVN::Ra=HASH(0x945dae8)',\n> 'HASH(0x92131e0)', 'HASH(0x9388050)', 7738) called at /usr/bin/git-svn\n> line 4062\n>        Git::SVN::Ra::match_globs('Git::SVN::Ra=HASH(0x945dae8)',\n> 'HASH(0x92131e0)', 'HASH(0x9463c00)', 'ARRAY(0x90bbc00)', 7738) called\n> at /usr/bin/git-svn line 3985\n>        Git::SVN::Ra::gs_fetch_loop_common('Git::SVN::Ra=HASH(0x945dae8)',\n> 7737, 16113, 'ARRAY(0x90bbbe0)', 'ARRAY(0x90bbc00)') called at\n> /usr/bin/git-svn line 1415\n>        Git::SVN::fetch_all('svn', 'HASH(0x9464250)') called at\n> /usr/bin/git-svn line 372\n>        main::cmd_fetch() called at /usr/bin/git-svn line 253\n>        eval {...} called at /usr/bin/git-svn line 251\n>\n>\n> I'll keep looking at it to see if I can figure out a way to \"skip\" the\n> error myself and, eventually, provide a patch\n\nI played a little with perl and modified the code\n\nI attach the patch I created...\nit probably sucks and doesn't take cares of a lot of thing that I\ndidn't thought about...\n\nAfter applying it I was able to continue the git svn fetch from the\npoint I left skipping those problematics paths...\n\nStill I get a lot of warnings with:\nUse of uninitialized value in concatenation (.) or string at\n/usr/lib/perl5/SVN/Core.pm line 584\n\n\nI just want you to take a look at it\nI will not be disappointed if you place this patch in the recycle bean :)\n\nI cloned the git repo, checked out the v1.5.6.5 tag (which is my\ncurrent version) and modified the git-svn.perl file.\n\nIt probably wont help but I think I should share it anyway\n\n(patch below my signature)\n\nBye,\nDaniele\n\nFrom e8a1a12e83b3f0b18ce842190d8fc8eddaa77f68 Mon Sep 17 00:00:00 2001\nFrom: Daniele Segato <daniele.bilug@gmail.com>\nDate: Mon, 7 Sep 2009 15:30:14 +0200\nSubject: [PATCH] Ignore error 175007 authorization failed on checkpath\n\nI don't know if this is the best solution to solve the issue but it does\nlet me download the repo skipping the problematics paths\n---\n git-svn.perl |   16 ++++++++++++++++\n 1 files changed, 16 insertions(+), 0 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex a366c89..0ab6453 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -3756,7 +3756,23 @@ sub check_path {\n \t\treturn $cache->{data}->{$path};\n \t}\n \tmy $pool = SVN::Pool->new;\n+\tmy $err_handler = $SVN::Error::handler;\n+\t$SVN::Error::handler = sub {\n+\t\t(my $err) = @_;\n+\t\tmy $errno = $err->apr_err();\n+\t\tmy $err_key = $err->expanded_message;\n+\t\tif ($errno == 175007) {\n+\t\t\twarn \"W: Ignoring error from SVN, path probably \",\n+\t\t\t\t\"does not exist: ($errno): \",\n+\t\t\t\t$err->expanded_message,\"\\n\";\n+\t\t}\n+\t\treturn;\n+\t};\n+\n \tmy $t = $self->SUPER::check_path($path, $r, $pool);\n+\n+\t$SVN::Error::handler = $err_handler;\n+\n \t$pool->clear;\n \tif ($r != $cache->{r}) {\n \t\t%{$cache->{data}} = ();\n-- \n1.5.6.5\n"},{"id":"122630","messageId":"9accb4400909070653s4ddb07e4k54dde8d801b4b5e4@mail.gmail.com","threadId":"20797","inReplyTo":"9accb4400909070634oee46b78g9270586a2b0eb4b9@mail.gmail.com","subject":"Re: how to skip branches on git svn clone/fetch when there are errors","fromName":"Daniele Segato","fromEmail":"daniele.bilug@gmail.com","sentAt":"2009-09-07T13:53:44Z","receivedAt":"2009-09-07T13:53:44Z","isPatch":false,"sender":{"key":"daniele.bilug@gmail.com","avatar":null},"body":"On Mon, Sep 7, 2009 at 3:34 PM, Daniele Segato<daniele.bilug@gmail.com> wrote:\n> +       $SVN::Error::handler = sub {\n> +               (my $err) = @_;\n> +               my $errno = $err->apr_err();\n> +               my $err_key = $err->expanded_message;\n> +               if ($errno == 175007) {\n> +                       warn \"W: Ignoring error from SVN, path probably \",\n> +                               \"does not exist: ($errno): \",\n> +                               $err->expanded_message,\"\\n\";\n> +               }\n> +               return;\n\n\n\nups..\nthis should have been return inside the if and die otherwise\n\nand the error is 170001 (wrong copy/paste)\n\nplease ignore the patch I posted before\n\nthis is the \"right\" one:\n\n\nFrom a17dfb0e268e11ce70587ccb48c359348f22ad99 Mon Sep 17 00:00:00 2001\nFrom: Daniele Segato <daniele.bilug@gmail.com>\nDate: Mon, 7 Sep 2009 15:30:14 +0200\nSubject: [PATCH] Ignore err:170001 authorizationfailed on checkpath\n\nI don't know if this is the best solution to solve the issue but it does\nlet me download the repo skipping the problematics paths\n---\n git-svn.perl |   17 +++++++++++++++++\n 1 files changed, 17 insertions(+), 0 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex a366c89..80f958d 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -3756,7 +3756,24 @@ sub check_path {\n \t\treturn $cache->{data}->{$path};\n \t}\n \tmy $pool = SVN::Pool->new;\n+\tmy $err_handler = $SVN::Error::handler;\n+\t$SVN::Error::handler = sub {\n+\t\t(my $err) = @_;\n+\t\tmy $errno = $err->apr_err();\n+\t\tmy $err_key = $err->expanded_message;\n+\t\tif ($errno == 170001) {\n+\t\t\twarn \"W: Ignoring error from SVN, path probably \",\n+\t\t\t\t\"does not exist: ($errno): \",\n+\t\t\t\t$err->expanded_message,\"\\n\";\n+\t\t\treturn;\n+\t\t}\n+\t\tdie \"Error from SVN, ($errno): \", $err->expanded_message,\"\\n\";\n+\t};\n+\n \tmy $t = $self->SUPER::check_path($path, $r, $pool);\n+\n+\t$SVN::Error::handler = $err_handler;\n+\n \t$pool->clear;\n \tif ($r != $cache->{r}) {\n \t\t%{$cache->{data}} = ();\n-- \n1.5.6.5\n"},{"id":"122635","messageId":"4d8e3fd30909070853u6f4bc179qac96edae5c83a864@mail.gmail.com","threadId":"20797","inReplyTo":"9accb4400909070634oee46b78g9270586a2b0eb4b9@mail.gmail.com","subject":"Re: how to skip branches on git svn clone/fetch when there are errors","fromName":"Paolo Ciarrocchi","fromEmail":"paolo.ciarrocchi@gmail.com","sentAt":"2009-09-07T15:53:21Z","receivedAt":"2009-09-07T15:53:21Z","isPatch":false,"sender":{"key":"paolo.ciarrocchi@gmail.com","avatar":null},"body":"On Mon, Sep 7, 2009 at 3:34 PM, Daniele Segato<daniele.bilug@gmail.com> wrote:\n[...]\n\nCiao Daniele,\n\n> From e8a1a12e83b3f0b18ce842190d8fc8eddaa77f68 Mon Sep 17 00:00:00 2001\n> From: Daniele Segato <daniele.bilug@gmail.com>\n> Date: Mon, 7 Sep 2009 15:30:14 +0200\n> Subject: [PATCH] Ignore error 175007 authorization failed on checkpath\n>\n> I don't know if this is the best solution to solve the issue but it does\n> let me download the repo skipping the problematics paths\n\nUsually these lines are for the commit message, I guess you don't want\nto store these two lines in git.git :-)\n\n> ---\n\nSo if you want to add comments like you did, write them after the 3\nminus and before the content of the patch.\n\n>  git-svn.perl |   16 ++++++++++++++++\n>  1 files changed, 16 insertions(+), 0 deletions(-)\n>\n> diff --git a/git-svn.perl b/git-svn.perl\n> index a366c89..0ab6453 100755\n\nCiao,\n-- \nPaolo\n"},{"id":"122634","messageId":"1252346140.8992.36.camel@localhost","threadId":"20797","inReplyTo":"4d8e3fd30909070853u6f4bc179qac96edae5c83a864@mail.gmail.com","subject":"Re: how to skip branches on git svn clone/fetch when there are errors","fromName":"Daniele Segato","fromEmail":"daniele.bilug@gmail.com","sentAt":"2009-09-07T17:55:40Z","receivedAt":"2009-09-07T17:55:40Z","isPatch":false,"sender":{"key":"daniele.bilug@gmail.com","avatar":null},"body":"Il giorno lun, 07/09/2009 alle 17.53 +0200, Paolo Ciarrocchi ha scritto:\n> > I don't know if this is the best solution to solve the issue but it does\n> > let me download the repo skipping the problematics paths\n> \n> Usually these lines are for the commit message, I guess you don't want\n> to store these two lines in git.git :-)\n\nno\nthat was my local commit\n(and I initially copied the wrong one....)\n\nIf my patch will be accepted (and I really doubt this will be the case)\nI'll fix that with a git commit amend / git rebase -i following the git\ndevelopers guide-lines :)\n"}]}