{"thread":{"id":"42665","subject":"may be bug in svn fetch no-follow-parent","startedAt":"2016-06-20T07:38:07Z","lastAt":"2016-06-24T11:05:39Z","messageCount":4,"participants":["Александр Овчинников","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"289658","messageId":"4094761466408188@web24o.yandex.ru","threadId":"42665","inReplyTo":null,"subject":"may be bug in svn fetch no-follow-parent","fromName":"Александр Овчинников","fromEmail":"proff@proff.email","sentAt":"2016-06-20T07:36:28Z","receivedAt":"2016-06-20T07:38:07Z","isPatch":false,"sender":{"key":"proff@proff.email","avatar":null},"body":"Why git svn fetch try to handle mergeinfo changes when no-follow-parent is enabled?\nGit try to follow parents regardless of this option value.\nIf branch created without this option then git will follow parent succesfully\nIf branch created with this option then git try to follow and fail with \"cannot find common ancestor\" error\nIf branch does not exists (ignored) then git try to follow and fail with \"couldn't find revmap\" error. It is very long operation\n"},{"id":"289711","messageId":"20160620215253.GA16566@dcvr.yhbt.net","threadId":"42665","inReplyTo":"4094761466408188@web24o.yandex.ru","subject":"Re: may be bug in svn fetch no-follow-parent","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2016-06-20T21:52:53Z","receivedAt":"2016-06-20T21:52:57Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"+Cc: a bunch of folks who may know better how mergeinfo works in git-svn\n\nАлександр Овчинников <proff@proff.email> wrote:\n> Why git svn fetch try to handle mergeinfo changes when\n> no-follow-parent is enabled?\n\nIt probably should not...  --no-follow-parent isn't a common\nconfig, though.  Can you try the patch below?\n\n> Git try to follow parents regardless of this option value.\n> If branch created without this option then git will follow\n> parent succesfully\n> If branch created with this option then git try to follow and\n> fail with \"cannot find common ancestor\" error\n> If branch does not exists (ignored) then git try to follow and\n> fail with \"couldn't find revmap\" error. It is very long\n> operation\n\nDo you have an example repo you could share with us?\n\nThanks.\n\nI still don't think I've encountered a repo which uses\nmergeinfo myself.\nHopefully the following patch works for you:\n\n---------8<--------\nSubject: [PATCH] git-svn: skip mergeinfo with --no-follow-parent\n\nFor repositories without parent following enabled, computing\nmergeinfo can be expensive and pointless.\n\nNote: Only tested on existing test cases.\n---\n perl/Git/SVN.pm | 25 ++++++++++++++++---------\n 1 file changed, 16 insertions(+), 9 deletions(-)\n\ndiff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm\nindex d94d01c..bee1e7d 100644\n--- a/perl/Git/SVN.pm\n+++ b/perl/Git/SVN.pm\n@@ -1905,15 +1905,22 @@ sub make_log_entry {\n \n \tmy @parents = @$parents;\n \tmy $props = $ed->{dir_prop}{$self->path};\n-\tif ( $props->{\"svk:merge\"} ) {\n-\t\t$self->find_extra_svk_parents($props->{\"svk:merge\"}, \\@parents);\n-\t}\n-\tif ( $props->{\"svn:mergeinfo\"} ) {\n-\t\tmy $mi_changes = $self->mergeinfo_changes\n-\t\t\t($parent_path, $parent_rev,\n-\t\t\t $self->path, $rev,\n-\t\t\t $props->{\"svn:mergeinfo\"});\n-\t\t$self->find_extra_svn_parents($mi_changes, \\@parents);\n+\tif ($self->follow_parent) {\n+\t\tmy $tickets = $props->{\"svk:merge\"};\n+\t\tif ($tickets) {\n+\t\t\t$self->find_extra_svk_parents($tickets, \\@parents);\n+\t\t}\n+\n+\t\tmy $mergeinfo_prop = $props->{\"svn:mergeinfo\"};\n+\t\tif ($mergeinfo_prop) {\n+\t\t\tmy $mi_changes = $self->mergeinfo_changes(\n+\t\t\t\t\t\t$parent_path,\n+\t\t\t\t\t\t$parent_rev,\n+\t\t\t\t\t\t$self->path,\n+\t\t\t\t\t\t$rev,\n+\t\t\t\t\t\t$mergeinfo_prop);\n+\t\t\t$self->find_extra_svn_parents($mi_changes, \\@parents);\n+\t\t}\n \t}\n \n \topen my $un, '>>', \"$self->{dir}/unhandled.log\" or croak $!;\n-- \nEW\n"},{"id":"289933","messageId":"20160622225839.GA30828@dcvr.yhbt.net","threadId":"42665","inReplyTo":"2518541466501215@web27h.yandex.ru","subject":"Re: may be bug in svn fetch no-follow-parent","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2016-06-22T22:58:39Z","receivedAt":"2016-06-22T22:59:04Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Александр Овчинников <proff@proff.email> wrote:\n> Unfortunately this is not open source repository. I agree that it is pointless try to handle mergeinfo (because it always fails).\n> Cases when it is expensive:\n> 1. delete and restore mergeinfo property\n> 2. merge trunk to very old branch\n> 3. create, delete, create branch with --no-follow-parent. All records in mergeinfo will be hadled like new.\n> \n> I already patched like this and this is helpfull, works fine and fast.\n\nThanks for the info.  Patch + pull request below for Junio.\n\n> I can share only mergeinfo property\n\nOops, looks like your zip attachment got flagged as spam for\nmy mailbox and swallowed by vger.kernel.org :x\n\n---------8<--------\nSubject: [PATCH] git-svn: skip mergeinfo handling with --no-follow-parent\n\nFor repositories without parent following enabled, finding\ngit parents through svn:mergeinfo or svk::parents can be\nexpensive and pointless.\n\nReported-by: Александр Овчинников <proff@proff.email>\n\thttp://mid.gmane.org/4094761466408188@web24o.yandex.ru\n\nSigned-off-by: Eric Wong <e@80x24.org>\n---\n  The following changes since commit ab7797dbe95fff38d9265869ea367020046db118:\n\n    Start the post-2.9 cycle (2016-06-20 11:06:49 -0700)\n\n  are available in the git repository at:\n\n    git://bogomips.org/git-svn.git svn-nfp-mergeinfo\n\n  for you to fetch changes up to 6d523a3ab76cfa4ed9ae0ed9da7af43efcff3f07:\n\n    git-svn: skip mergeinfo handling with --no-follow-parent (2016-06-22 22:48:54 +0000)\n\n  ----------------------------------------------------------------\n  Eric Wong (1):\n        git-svn: skip mergeinfo handling with --no-follow-parent\n\n perl/Git/SVN.pm | 25 ++++++++++++++++---------\n 1 file changed, 16 insertions(+), 9 deletions(-)\n\ndiff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm\nindex d94d01c..bee1e7d 100644\n--- a/perl/Git/SVN.pm\n+++ b/perl/Git/SVN.pm\n@@ -1905,15 +1905,22 @@ sub make_log_entry {\n \n \tmy @parents = @$parents;\n \tmy $props = $ed->{dir_prop}{$self->path};\n-\tif ( $props->{\"svk:merge\"} ) {\n-\t\t$self->find_extra_svk_parents($props->{\"svk:merge\"}, \\@parents);\n-\t}\n-\tif ( $props->{\"svn:mergeinfo\"} ) {\n-\t\tmy $mi_changes = $self->mergeinfo_changes\n-\t\t\t($parent_path, $parent_rev,\n-\t\t\t $self->path, $rev,\n-\t\t\t $props->{\"svn:mergeinfo\"});\n-\t\t$self->find_extra_svn_parents($mi_changes, \\@parents);\n+\tif ($self->follow_parent) {\n+\t\tmy $tickets = $props->{\"svk:merge\"};\n+\t\tif ($tickets) {\n+\t\t\t$self->find_extra_svk_parents($tickets, \\@parents);\n+\t\t}\n+\n+\t\tmy $mergeinfo_prop = $props->{\"svn:mergeinfo\"};\n+\t\tif ($mergeinfo_prop) {\n+\t\t\tmy $mi_changes = $self->mergeinfo_changes(\n+\t\t\t\t\t\t$parent_path,\n+\t\t\t\t\t\t$parent_rev,\n+\t\t\t\t\t\t$self->path,\n+\t\t\t\t\t\t$rev,\n+\t\t\t\t\t\t$mergeinfo_prop);\n+\t\t\t$self->find_extra_svn_parents($mi_changes, \\@parents);\n+\t\t}\n \t}\n \n \topen my $un, '>>', \"$self->{dir}/unhandled.log\" or croak $!;\n-- \nEW\n"},{"id":"290013","messageId":"3485951466765826@web27g.yandex.ru","threadId":"42665","inReplyTo":"20160622225839.GA30828@dcvr.yhbt.net","subject":"Re: may be bug in svn fetch no-follow-parent","fromName":"Александр Овчинников","fromEmail":"proff@proff.email","sentAt":"2016-06-24T10:57:06Z","receivedAt":"2016-06-24T11:05:39Z","isPatch":false,"sender":{"key":"proff@proff.email","avatar":null},"body":"https://s3-eu-west-1.amazonaws.com/profff/mergeinfo.zip\n\neven ordinary merge may take up to 20-30 minutes. I'll try to trace in future\n\n23.06.2016, 01:58, \"Eric Wong\" <e@80x24.org>:\n> Александр Овчинников <proff@proff.email> wrote:\n>>  Unfortunately this is not open source repository. I agree that it is pointless try to handle mergeinfo (because it always fails).\n>>  Cases when it is expensive:\n>>  1. delete and restore mergeinfo property\n>>  2. merge trunk to very old branch\n>>  3. create, delete, create branch with --no-follow-parent. All records in mergeinfo will be hadled like new.\n>>\n>>  I already patched like this and this is helpfull, works fine and fast.\n>\n> Thanks for the info. Patch + pull request below for Junio.\n>\n>>  I can share only mergeinfo property\n>\n> Oops, looks like your zip attachment got flagged as spam for\n> my mailbox and swallowed by vger.kernel.org :x\n>\n> ---------8<--------\n> Subject: [PATCH] git-svn: skip mergeinfo handling with --no-follow-parent\n>\n> For repositories without parent following enabled, finding\n> git parents through svn:mergeinfo or svk::parents can be\n> expensive and pointless.\n>\n> Reported-by: Александр Овчинников <proff@proff.email>\n>         http://mid.gmane.org/4094761466408188@web24o.yandex.ru\n>\n> Signed-off-by: Eric Wong <e@80x24.org>\n> ---\n>   The following changes since commit ab7797dbe95fff38d9265869ea367020046db118:\n>\n>     Start the post-2.9 cycle (2016-06-20 11:06:49 -0700)\n>\n>   are available in the git repository at:\n>\n>     git://bogomips.org/git-svn.git svn-nfp-mergeinfo\n>\n>   for you to fetch changes up to 6d523a3ab76cfa4ed9ae0ed9da7af43efcff3f07:\n>\n>     git-svn: skip mergeinfo handling with --no-follow-parent (2016-06-22 22:48:54 +0000)\n>\n>   ----------------------------------------------------------------\n>   Eric Wong (1):\n>         git-svn: skip mergeinfo handling with --no-follow-parent\n>\n>  perl/Git/SVN.pm | 25 ++++++++++++++++---------\n>  1 file changed, 16 insertions(+), 9 deletions(-)\n>\n> diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm\n> index d94d01c..bee1e7d 100644\n> --- a/perl/Git/SVN.pm\n> +++ b/perl/Git/SVN.pm\n> @@ -1905,15 +1905,22 @@ sub make_log_entry {\n>\n>          my @parents = @$parents;\n>          my $props = $ed->{dir_prop}{$self->path};\n> - if ( $props->{\"svk:merge\"} ) {\n> - $self->find_extra_svk_parents($props->{\"svk:merge\"}, \\@parents);\n> - }\n> - if ( $props->{\"svn:mergeinfo\"} ) {\n> - my $mi_changes = $self->mergeinfo_changes\n> - ($parent_path, $parent_rev,\n> - $self->path, $rev,\n> - $props->{\"svn:mergeinfo\"});\n> - $self->find_extra_svn_parents($mi_changes, \\@parents);\n> + if ($self->follow_parent) {\n> + my $tickets = $props->{\"svk:merge\"};\n> + if ($tickets) {\n> + $self->find_extra_svk_parents($tickets, \\@parents);\n> + }\n> +\n> + my $mergeinfo_prop = $props->{\"svn:mergeinfo\"};\n> + if ($mergeinfo_prop) {\n> + my $mi_changes = $self->mergeinfo_changes(\n> + $parent_path,\n> + $parent_rev,\n> + $self->path,\n> + $rev,\n> + $mergeinfo_prop);\n> + $self->find_extra_svn_parents($mi_changes, \\@parents);\n> + }\n>          }\n>\n>          open my $un, '>>', \"$self->{dir}/unhandled.log\" or croak $!;\n> --\n> EW\n"}]}