All of lore.kernel.org
 help / color / mirror / Atom feed
* may be bug in svn fetch no-follow-parent
@ 2016-06-20  7:36 Александр Овчинников
  2016-06-20 21:52 ` Eric Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Александр Овчинников @ 2016-06-20  7:36 UTC (permalink / raw)
  To: git

Why git svn fetch try to handle mergeinfo changes when no-follow-parent is enabled?
Git try to follow parents regardless of this option value.
If branch created without this option then git will follow parent succesfully
If branch created with this option then git try to follow and fail with "cannot find common ancestor" error
If branch does not exists (ignored) then git try to follow and fail with "couldn't find revmap" error. It is very long operation

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: may be bug in svn fetch no-follow-parent
  2016-06-20  7:36 may be bug in svn fetch no-follow-parent Александр Овчинников
@ 2016-06-20 21:52 ` Eric Wong
       [not found]   ` <2518541466501215@web27h.yandex.ru>
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Wong @ 2016-06-20 21:52 UTC (permalink / raw)
  To: Александр
	Овчинников
  Cc: git, Jakob Stoklund Olesen, Sam Vilain, Steven Walter,
	Peter Baumann, Andrew Myrick, Michael Contreras

+Cc: a bunch of folks who may know better how mergeinfo works in git-svn

Александр Овчинников <proff@proff.email> wrote:
> Why git svn fetch try to handle mergeinfo changes when
> no-follow-parent is enabled?

It probably should not...  --no-follow-parent isn't a common
config, though.  Can you try the patch below?

> Git try to follow parents regardless of this option value.
> If branch created without this option then git will follow
> parent succesfully
> If branch created with this option then git try to follow and
> fail with "cannot find common ancestor" error
> If branch does not exists (ignored) then git try to follow and
> fail with "couldn't find revmap" error. It is very long
> operation

Do you have an example repo you could share with us?

Thanks.

I still don't think I've encountered a repo which uses
mergeinfo myself.
Hopefully the following patch works for you:

---------8<--------
Subject: [PATCH] git-svn: skip mergeinfo with --no-follow-parent

For repositories without parent following enabled, computing
mergeinfo can be expensive and pointless.

Note: Only tested on existing test cases.
---
 perl/Git/SVN.pm | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
index d94d01c..bee1e7d 100644
--- a/perl/Git/SVN.pm
+++ b/perl/Git/SVN.pm
@@ -1905,15 +1905,22 @@ sub make_log_entry {
 
 	my @parents = @$parents;
 	my $props = $ed->{dir_prop}{$self->path};
-	if ( $props->{"svk:merge"} ) {
-		$self->find_extra_svk_parents($props->{"svk:merge"}, \@parents);
-	}
-	if ( $props->{"svn:mergeinfo"} ) {
-		my $mi_changes = $self->mergeinfo_changes
-			($parent_path, $parent_rev,
-			 $self->path, $rev,
-			 $props->{"svn:mergeinfo"});
-		$self->find_extra_svn_parents($mi_changes, \@parents);
+	if ($self->follow_parent) {
+		my $tickets = $props->{"svk:merge"};
+		if ($tickets) {
+			$self->find_extra_svk_parents($tickets, \@parents);
+		}
+
+		my $mergeinfo_prop = $props->{"svn:mergeinfo"};
+		if ($mergeinfo_prop) {
+			my $mi_changes = $self->mergeinfo_changes(
+						$parent_path,
+						$parent_rev,
+						$self->path,
+						$rev,
+						$mergeinfo_prop);
+			$self->find_extra_svn_parents($mi_changes, \@parents);
+		}
 	}
 
 	open my $un, '>>', "$self->{dir}/unhandled.log" or croak $!;
-- 
EW

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: may be bug in svn fetch no-follow-parent
       [not found]   ` <2518541466501215@web27h.yandex.ru>
@ 2016-06-22 22:58     ` Eric Wong
  2016-06-24 10:57       ` Александр Овчинников
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Wong @ 2016-06-22 22:58 UTC (permalink / raw)
  To: Александр
	Овчинников,
	Junio C Hamano
  Cc: git, Jakob Stoklund Olesen, Sam Vilain, Steven Walter,
	Peter Baumann, Andrew Myrick, Michael Contreras

Александр Овчинников <proff@proff.email> wrote:
> Unfortunately this is not open source repository. I agree that it is pointless try to handle mergeinfo (because it always fails).
> Cases when it is expensive:
> 1. delete and restore mergeinfo property
> 2. merge trunk to very old branch
> 3. create, delete, create branch with --no-follow-parent. All records in mergeinfo will be hadled like new.
> 
> I already patched like this and this is helpfull, works fine and fast.

Thanks for the info.  Patch + pull request below for Junio.

> I can share only mergeinfo property

Oops, looks like your zip attachment got flagged as spam for
my mailbox and swallowed by vger.kernel.org :x

---------8<--------
Subject: [PATCH] git-svn: skip mergeinfo handling with --no-follow-parent

For repositories without parent following enabled, finding
git parents through svn:mergeinfo or svk::parents can be
expensive and pointless.

Reported-by: Александр Овчинников <proff@proff.email>
	http://mid.gmane.org/4094761466408188@web24o.yandex.ru

Signed-off-by: Eric Wong <e@80x24.org>
---
  The following changes since commit ab7797dbe95fff38d9265869ea367020046db118:

    Start the post-2.9 cycle (2016-06-20 11:06:49 -0700)

  are available in the git repository at:

    git://bogomips.org/git-svn.git svn-nfp-mergeinfo

  for you to fetch changes up to 6d523a3ab76cfa4ed9ae0ed9da7af43efcff3f07:

    git-svn: skip mergeinfo handling with --no-follow-parent (2016-06-22 22:48:54 +0000)

  ----------------------------------------------------------------
  Eric Wong (1):
        git-svn: skip mergeinfo handling with --no-follow-parent

 perl/Git/SVN.pm | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
index d94d01c..bee1e7d 100644
--- a/perl/Git/SVN.pm
+++ b/perl/Git/SVN.pm
@@ -1905,15 +1905,22 @@ sub make_log_entry {
 
 	my @parents = @$parents;
 	my $props = $ed->{dir_prop}{$self->path};
-	if ( $props->{"svk:merge"} ) {
-		$self->find_extra_svk_parents($props->{"svk:merge"}, \@parents);
-	}
-	if ( $props->{"svn:mergeinfo"} ) {
-		my $mi_changes = $self->mergeinfo_changes
-			($parent_path, $parent_rev,
-			 $self->path, $rev,
-			 $props->{"svn:mergeinfo"});
-		$self->find_extra_svn_parents($mi_changes, \@parents);
+	if ($self->follow_parent) {
+		my $tickets = $props->{"svk:merge"};
+		if ($tickets) {
+			$self->find_extra_svk_parents($tickets, \@parents);
+		}
+
+		my $mergeinfo_prop = $props->{"svn:mergeinfo"};
+		if ($mergeinfo_prop) {
+			my $mi_changes = $self->mergeinfo_changes(
+						$parent_path,
+						$parent_rev,
+						$self->path,
+						$rev,
+						$mergeinfo_prop);
+			$self->find_extra_svn_parents($mi_changes, \@parents);
+		}
 	}
 
 	open my $un, '>>', "$self->{dir}/unhandled.log" or croak $!;
-- 
EW

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: may be bug in svn fetch no-follow-parent
  2016-06-22 22:58     ` Eric Wong
@ 2016-06-24 10:57       ` Александр Овчинников
  0 siblings, 0 replies; 4+ messages in thread
From: Александр Овчинников @ 2016-06-24 10:57 UTC (permalink / raw)
  To: Eric Wong, Junio C Hamano
  Cc: git, Jakob Stoklund Olesen, Sam Vilain, Steven Walter,
	Peter Baumann, Andrew Myrick, Michael Contreras

https://s3-eu-west-1.amazonaws.com/profff/mergeinfo.zip

even ordinary merge may take up to 20-30 minutes. I'll try to trace in future

23.06.2016, 01:58, "Eric Wong" <e@80x24.org>:
> Александр Овчинников <proff@proff.email> wrote:
>>  Unfortunately this is not open source repository. I agree that it is pointless try to handle mergeinfo (because it always fails).
>>  Cases when it is expensive:
>>  1. delete and restore mergeinfo property
>>  2. merge trunk to very old branch
>>  3. create, delete, create branch with --no-follow-parent. All records in mergeinfo will be hadled like new.
>>
>>  I already patched like this and this is helpfull, works fine and fast.
>
> Thanks for the info. Patch + pull request below for Junio.
>
>>  I can share only mergeinfo property
>
> Oops, looks like your zip attachment got flagged as spam for
> my mailbox and swallowed by vger.kernel.org :x
>
> ---------8<--------
> Subject: [PATCH] git-svn: skip mergeinfo handling with --no-follow-parent
>
> For repositories without parent following enabled, finding
> git parents through svn:mergeinfo or svk::parents can be
> expensive and pointless.
>
> Reported-by: Александр Овчинников <proff@proff.email>
>         http://mid.gmane.org/4094761466408188@web24o.yandex.ru
>
> Signed-off-by: Eric Wong <e@80x24.org>
> ---
>   The following changes since commit ab7797dbe95fff38d9265869ea367020046db118:
>
>     Start the post-2.9 cycle (2016-06-20 11:06:49 -0700)
>
>   are available in the git repository at:
>
>     git://bogomips.org/git-svn.git svn-nfp-mergeinfo
>
>   for you to fetch changes up to 6d523a3ab76cfa4ed9ae0ed9da7af43efcff3f07:
>
>     git-svn: skip mergeinfo handling with --no-follow-parent (2016-06-22 22:48:54 +0000)
>
>   ----------------------------------------------------------------
>   Eric Wong (1):
>         git-svn: skip mergeinfo handling with --no-follow-parent
>
>  perl/Git/SVN.pm | 25 ++++++++++++++++---------
>  1 file changed, 16 insertions(+), 9 deletions(-)
>
> diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
> index d94d01c..bee1e7d 100644
> --- a/perl/Git/SVN.pm
> +++ b/perl/Git/SVN.pm
> @@ -1905,15 +1905,22 @@ sub make_log_entry {
>
>          my @parents = @$parents;
>          my $props = $ed->{dir_prop}{$self->path};
> - if ( $props->{"svk:merge"} ) {
> - $self->find_extra_svk_parents($props->{"svk:merge"}, \@parents);
> - }
> - if ( $props->{"svn:mergeinfo"} ) {
> - my $mi_changes = $self->mergeinfo_changes
> - ($parent_path, $parent_rev,
> - $self->path, $rev,
> - $props->{"svn:mergeinfo"});
> - $self->find_extra_svn_parents($mi_changes, \@parents);
> + if ($self->follow_parent) {
> + my $tickets = $props->{"svk:merge"};
> + if ($tickets) {
> + $self->find_extra_svk_parents($tickets, \@parents);
> + }
> +
> + my $mergeinfo_prop = $props->{"svn:mergeinfo"};
> + if ($mergeinfo_prop) {
> + my $mi_changes = $self->mergeinfo_changes(
> + $parent_path,
> + $parent_rev,
> + $self->path,
> + $rev,
> + $mergeinfo_prop);
> + $self->find_extra_svn_parents($mi_changes, \@parents);
> + }
>          }
>
>          open my $un, '>>', "$self->{dir}/unhandled.log" or croak $!;
> --
> EW

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-24 11:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-20  7:36 may be bug in svn fetch no-follow-parent Александр Овчинников
2016-06-20 21:52 ` Eric Wong
     [not found]   ` <2518541466501215@web27h.yandex.ru>
2016-06-22 22:58     ` Eric Wong
2016-06-24 10:57       ` Александр Овчинников

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.