git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: "Александр Овчинников" <proff@proff.email>
Cc: git@vger.kernel.org, Jakob Stoklund Olesen <stoklund@2pi.dk>,
	Sam Vilain <sam@vilain.net>,
	Steven Walter <stevenrwalter@gmail.com>,
	Peter Baumann <waste.manager@gmx.de>,
	Andrew Myrick <amyrick@apple.com>,
	Michael Contreras <michael@inetric.com>
Subject: Re: may be bug in svn fetch no-follow-parent
Date: Mon, 20 Jun 2016 21:52:53 +0000	[thread overview]
Message-ID: <20160620215253.GA16566@dcvr.yhbt.net> (raw)
In-Reply-To: <4094761466408188@web24o.yandex.ru>

+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

  reply	other threads:[~2016-06-20 21:52 UTC|newest]

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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160620215253.GA16566@dcvr.yhbt.net \
    --to=e@80x24.org \
    --cc=amyrick@apple.com \
    --cc=git@vger.kernel.org \
    --cc=michael@inetric.com \
    --cc=proff@proff.email \
    --cc=sam@vilain.net \
    --cc=stevenrwalter@gmail.com \
    --cc=stoklund@2pi.dk \
    --cc=waste.manager@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).