git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: may be bug in svn fetch no-follow-parent

From
EWEric Wong <e@80x24.org>
Date
Jun 20, 2016, 21:52 UTC
Message-ID
<20160620215253.GA16566@dcvr.yhbt.net>
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?

Show 8 quoted lines
> 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
Previous: Александр ОвчинниковNext: Eric Wong
Message 2 of 4 in “may be bug in svn fetch no-follow-parent”
  1. Александр ОвчинниковJun 20, 2016
  2. Eric WongJun 20, 2016
  3. Eric WongJun 22, 2016
  4. Александр ОвчинниковJun 24, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.