Skip to contentSkip to conversation

Efficiency and correctness patches for git-svn mergeinfo support

PATCH In review Sam Vilain 3 participants 13 messages Jun 15, 2016

lore
Share & tools
lore

Sam Vilain

author
#0 lore raw

This series implements some efficiency enhancements; particularly in dealing with repositories which have a single trunk branch which receives many merges of feature branches and/or cherry-picks. It also fixes a number of corner cases in the merge conversion code.

It would be nice if the people who have experienced slow git-svn performance in these situations could test that this fixes the performance issues, and that the resulting repositories seem to have correct contents.

Eric, I'm using Alex's trick of a single commit which adds failing tests - marked as _expect_failure - and then marked them as succeeding as the series progresses.

author
#1 lore raw

PATCH 1/5 git-svn: expand the svn mergeinfo test suite, highlighting some failures

As shown, git-svn has some problems; not all svn merges are correctly detected, and cherry picks may incorrectly be detected as real merges. These test cases will be marked as _success once the relevant fixes are in.

---
 t/t9151-svn-mergeinfo.sh   |   27 ++-
 t/t9151/make-svnmerge-dump |  166 ++++++---
 t/t9151/svn-mergeinfo.dump |  839 ++++++++++++++++++++++++++++++++++++++------
 3 files changed, 860 insertions(+), 172 deletions(-)
t/t9151-svn-mergeinfo.sh +21 -6
index f57daf4..dc3478f 100755
@@ -15,12 +15,27 @@ test_expect_success 'load svn dump' "
 	git svn fetch --all
 	"
 
-test_expect_success 'represent svn merges without intervening commits' "
-	[ `git cat-file commit HEAD^1 | grep parent | wc -l` -eq 2 ]
-	"
+test_expect_failure 'all svn merges became git merge commits' '
+	unmarked=$(git rev-list --parents --all --grep=Merge |
+		grep -v " .* " | cut -f1 -d" ")
+	[ -z "$unmarked" ]
+	'
 
-test_expect_success 'represent svn merges with intervening commits' "
-	[ `git cat-file commit HEAD | grep parent | wc -l` -eq 2 ]
-	"
+test_expect_failure 'cherry picks did not become git merge commits' '
+	bad_cherries=$(git rev-list --parents --all --grep=Cherry |
+		grep " .* " | cut -f1 -d" ")
+	[ -z "$bad_cherries" ]
+	'
+
+test_expect_success 'svn non-merge merge commits did not become git merge commits' '
+	bad_non_merges=$(git rev-list --parents --all --grep=non-merge |
+		grep " .* " | cut -f1 -d" ")
+	[ -z "$bad_non_merges" ]
+	'
+
+test_expect_failure 'everything got merged in the end' '
+	unmerged=$(git rev-list --all --not master)
+	[ -z "$unmerged" ]
+	'
 
 test_done
t/t9151/make-svnmerge-dump +112 -54

205 lines not on this page · raw message

t/t9151/svn-mergeinfo.dump +727 -112

1,065 lines not on this page · raw message

Signature · 1 line
1.6.3.3
author
#2 lore raw

PATCH 2/5 git-svn: memoize conversion of SVN merge ticket info to git commit ranges

Each time the svn mergeinfo ticket changes, we look it up in the rev_map; when there are a lot of merged branches, this will result in many repeated lookups of the same information for subsequent commits. Arrange the slow part of the function so that it may be memoized, and memoize it. The more expensive revision walking operation can be memoized separately.

---
 git-svn.perl |   91 ++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 54 insertions(+), 37 deletions(-)
git-svn.perl +54 -37
index a4b052c..3b17a83 100755
@@ -1634,6 +1634,7 @@ use Carp qw/croak/;
 use File::Path qw/mkpath/;
 use File::Copy qw/copy/;
 use IPC::Open3;
+use Memoize;  # core since 5.8.0, Jul 2002
 
 my ($_gc_nr, $_gc_period);
 
@@ -2967,6 +2968,55 @@ sub find_extra_svk_parents {
 	}
 }
 
+sub lookup_svn_merge {
+	my $uuid = shift;
+	my $url = shift;
+	my $merge = shift;
+
+	my ($source, $revs) = split ":", $merge;
+	my $path = $source;
+	$path =~ s{^/}{};
+	my $gs = Git::SVN->find_by_url($url.$source, $url, $path);
+	if ( !$gs ) {
+		warn "Couldn't find revmap for $url$source\n";
+		next;
+	}
+	my @ranges = split ",", $revs;
+	my ($tip, $tip_commit);
+	my @merged_commit_ranges;
+	# find the tip
+	for my $range ( @ranges ) {
+		my ($bottom, $top) = split "-", $range;
+		$top ||= $bottom;
+		my $bottom_commit =
+			$gs->rev_map_get($bottom, $uuid) ||
+			$gs->rev_map_get($bottom+1, $uuid);
+		my $top_commit;
+		for (; !$top_commit && $top >= $bottom; --$top) {
+			$top_commit =
+				$gs->rev_map_get($top, $uuid);
+		}
+
+		unless ($top_commit and $bottom_commit) {
+			warn "W:unknown path/rev in svn:mergeinfo "
+				."dirprop: $source:$range\n";
+			next;
+		}
+
+		push @merged_commit_ranges,
+			"$bottom_commit..$top_commit";
+
+		if ( !defined $tip or $top > $tip ) {
+			$tip = $top;
+			$tip_commit = $top_commit;
+		}
+	}
+	return ($tip_commit, @merged_commit_ranges);
+}
+BEGIN {
+	memoize 'lookup_svn_merge';
+}
+
 # note: this function should only be called if the various dirprops
 # have actually changed
 sub find_extra_svn_parents {
@@ -2981,44 +3031,11 @@ sub find_extra_svn_parents {
 	my @merge_tips;
 	my @merged_commit_ranges;
 	my $url = $self->rewrite_root || $self->{url};
+	my $uuid = $self->ra_uuid;
 	for my $merge ( @merges ) {
-		my ($source, $revs) = split ":", $merge;
-		my $path = $source;
-		$path =~ s{^/}{};
-		my $gs = Git::SVN->find_by_url($url.$source, $url, $path);
-		if ( !$gs ) {
-			warn "Couldn't find revmap for $url$source\n";
-			next;
-		}
-		my @ranges = split ",", $revs;
-		my ($tip, $tip_commit);
-		# find the tip
-		for my $range ( @ranges ) {
-			my ($bottom, $top) = split "-", $range;
-			$top ||= $bottom;
-			my $bottom_commit =
-				$gs->rev_map_get($bottom, $self->ra_uuid) ||
-				$gs->rev_map_get($bottom+1, $self->ra_uuid);
-			my $top_commit;
-			for (; !$top_commit && $top >= $bottom; --$top) {
-				$top_commit =
-					$gs->rev_map_get($top, $self->ra_uuid);
-			}
-
-			unless ($top_commit and $bottom_commit) {
-				warn "W:unknown path/rev in svn:mergeinfo "
-					."dirprop: $source:$range\n";
-				next;
-			}
-
-			push @merged_commit_ranges,
-				"$bottom_commit..$top_commit";
-
-			if ( !defined $tip or $top > $tip ) {
-				$tip = $top;
-				$tip_commit = $top_commit;
-			}
-		}
+		my ($tip_commit, @ranges) =
+			lookup_svn_merge( $uuid, $url, $merge );
+		push @merged_commit_ranges, @ranges;
 		unless (!$tip_commit or
 				grep { $_ eq $tip_commit } @$parents ) {
 			push @merge_tips, $tip_commit;
Signature · 1 line
1.6.3.3
author
#3 lore raw

PATCH 3/5 git-svn: fix some mistakes with interpreting SVN mergeinfo commit ranges

SVN's list of commit ranges in mergeinfo tickets is inclusive, whereas git commit ranges are exclusive on the left hand side. Also, the end points of the commit ranges may not exist; they simply delineate ranges of commits which may or may not exist. Fix these two mistakes.

---
 git-svn.perl             |   12 +++---------
 t/t9151-svn-mergeinfo.sh |    2 +-
 2 files changed, 4 insertions(+), 10 deletions(-)
git-svn.perl +3 -9
index 3b17a83..9cf4a3e 100755
@@ -2988,14 +2988,8 @@ sub lookup_svn_merge {
 	for my $range ( @ranges ) {
 		my ($bottom, $top) = split "-", $range;
 		$top ||= $bottom;
-		my $bottom_commit =
-			$gs->rev_map_get($bottom, $uuid) ||
-			$gs->rev_map_get($bottom+1, $uuid);
-		my $top_commit;
-		for (; !$top_commit && $top >= $bottom; --$top) {
-			$top_commit =
-				$gs->rev_map_get($top, $uuid);
-		}
+		my $bottom_commit = $gs->find_rev_after( $bottom, 1, $top );
+		my $top_commit = $gs->find_rev_before( $top, 1, $bottom );
 
 		unless ($top_commit and $bottom_commit) {
 			warn "W:unknown path/rev in svn:mergeinfo "
@@ -3004,7 +2998,7 @@ sub lookup_svn_merge {
 		}
 
 		push @merged_commit_ranges,
-			"$bottom_commit..$top_commit";
+			"$bottom_commit^..$top_commit";
 
 		if ( !defined $tip or $top > $tip ) {
 			$tip = $top;
t/t9151-svn-mergeinfo.sh +1 -1
index dc3478f..f6e00ea 100755
@@ -33,7 +33,7 @@ test_expect_success 'svn non-merge merge commits did not become git merge commit
 	[ -z "$bad_non_merges" ]
 	'
 
-test_expect_failure 'everything got merged in the end' '
+test_expect_success 'everything got merged in the end' '
 	unmerged=$(git rev-list --all --not master)
 	[ -z "$unmerged" ]
 	'
Signature · 1 line
1.6.3.3
author
#4 lore raw

PATCH 4/5 git-svn: exclude already merged tips using one rev-list call

The old function would have to check all mentioned merge tips, every time that the mergeinfo ticket changed. This involved 1-2 rev-list operation for each listed mergeinfo line. If there are a lot of feature branches being merged into a trunk, this makes for a very expensive operation for detecting the new parents on every merge.

This new version first uses a single 'rev-list' to figure out which commit ranges are already reachable from the parents. This is used to eliminate the already merged branches from the list.

---
 git-svn.perl |   52 ++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 48 insertions(+), 4 deletions(-)
git-svn.perl +48 -4
index 9cf4a3e..7a790d7 100755
@@ -3011,6 +3011,41 @@ BEGIN {
 	memoize 'lookup_svn_merge';
 }
 
+sub parents_exclude {
+	my $parents = shift;
+	my @commits = @_;
+	return unless @commits;
+
+	my @excluded;
+	my $excluded;
+	do {
+		my @cmd = ('rev-list', "-1", @commits, "--not", @$parents );
+		$excluded = command_oneline(@cmd);
+		if ( $excluded ) {
+			my @new;
+			my $found;
+			for my $commit ( @commits ) {
+				if ( $commit eq $excluded ) {
+					push @excluded, $commit;
+					$found++;
+					last;
+				}
+				else {
+					push @new, $commit;
+				}
+			}
+			die "saw commit '$excluded' in rev-list output, "
+				."but we didn't ask for that commit (wanted: @commits --not @$parents)"
+					unless $found;
+			@commits = @new;
+		}
+	}
+		while ($excluded and @commits);
+
+	return @excluded;
+}
+
+
 # note: this function should only be called if the various dirprops
 # have actually changed
 sub find_extra_svn_parents {
@@ -3023,23 +3058,32 @@ sub find_extra_svn_parents {
 	# are now marked as merge, we can add the tip as a parent.
 	my @merges = split "\n", $mergeinfo;
 	my @merge_tips;
-	my @merged_commit_ranges;
 	my $url = $self->rewrite_root || $self->{url};
 	my $uuid = $self->ra_uuid;
+	my %ranges;
 	for my $merge ( @merges ) {
 		my ($tip_commit, @ranges) =
 			lookup_svn_merge( $uuid, $url, $merge );
-		push @merged_commit_ranges, @ranges;
 		unless (!$tip_commit or
 				grep { $_ eq $tip_commit } @$parents ) {
 			push @merge_tips, $tip_commit;
+			$ranges{$tip_commit} = \@ranges;
 		} else {
 			push @merge_tips, undef;
 		}
 	}
+
+	my %excluded = map { $_ => 1 }
+		parents_exclude($parents, grep { defined } @merge_tips);
+
+	# check merge tips for new parents
+	my @new_parents;
 	for my $merge_tip ( @merge_tips ) {
 		my $spec = shift @merges;
-		next unless $merge_tip;
+		next unless $merge_tip and $excluded{$merge_tip};
+
+		my $ranges = $ranges{$merge_tip};
+
 		my @cmd = ('rev-list', "-1", $merge_tip,
 			   "--not", @$parents );
 		my ($msg_fh, $ctx) = command_output_pipe(@cmd);
@@ -3049,7 +3093,7 @@ sub find_extra_svn_parents {
 		}
 		command_close_pipe($msg_fh, $ctx);
 		if ( $new ) {
-			push @cmd, @merged_commit_ranges;
+			push @cmd, @$ranges;
 			my ($msg_fh, $ctx) = command_output_pipe(@cmd);
 			my $unmerged;
 			while ( <$msg_fh> ) {
Signature · 1 line
1.6.3.3
author
#5 lore raw

PATCH 5/5 git-svn: detect cherry-picks correctly.

The old function was incorrect; in some instances it marks a cherry picked range as a merged branch (because of an incorrect assumption that 'rev-list COMMIT --not RANGE' would work). This is replaced with a function which should detect them correctly, memoized to limit the expense of dealing with branches with many cherry picks to one 'merge-base' call per merge, per branch which used cherry picking.

---
 git-svn.perl             |   87 +++++++++++++++++++++++++++++++++------------
 t/t9151-svn-mergeinfo.sh |    4 +-
 2 files changed, 66 insertions(+), 25 deletions(-)
git-svn.perl +64 -23
index 7a790d7..f06e535 100755
@@ -3007,8 +3007,35 @@ sub lookup_svn_merge {
 	}
 	return ($tip_commit, @merged_commit_ranges);
 }
+
+sub _rev_list {
+	my ($msg_fh, $ctx) = command_output_pipe(
+		"rev-list", @_,
+	       );
+	my @rv;
+	while ( <$msg_fh> ) {
+		chomp;
+		push @rv, $_;
+	}
+	command_close_pipe($msg_fh, $ctx);
+	@rv;
+}
+
+sub check_cherry_pick {
+	my $base = shift;
+	my $tip = shift;
+	my @ranges = @_;
+	my %commits = map { $_ => 1 }
+		_rev_list("--no-merges", $tip, "--not", $base);
+	for my $range ( @ranges ) {
+		delete @commits{_rev_list($range)};
+	}
+	return (keys %commits);
+}
+
 BEGIN {
 	memoize 'lookup_svn_merge';
+	memoize 'check_cherry_pick';
 }
 
 sub parents_exclude {
@@ -3084,32 +3111,46 @@ sub find_extra_svn_parents {
 
 		my $ranges = $ranges{$merge_tip};
 
-		my @cmd = ('rev-list', "-1", $merge_tip,
-			   "--not", @$parents );
-		my ($msg_fh, $ctx) = command_output_pipe(@cmd);
-		my $new;
-		while ( <$msg_fh> ) {
-			$new=1;last;
-		}
-		command_close_pipe($msg_fh, $ctx);
-		if ( $new ) {
-			push @cmd, @$ranges;
-			my ($msg_fh, $ctx) = command_output_pipe(@cmd);
-			my $unmerged;
-			while ( <$msg_fh> ) {
-				$unmerged=1;last;
-			}
-			command_close_pipe($msg_fh, $ctx);
-			if ( $unmerged ) {
-				warn "W:svn cherry-pick ignored ($spec)\n";
-			} else {
-				warn
-				  "Found merge parent (svn:mergeinfo prop): ",
-				  $merge_tip, "\n";
-				push @$parents, $merge_tip;
+		# check out 'new' tips
+		my $merge_base = command_oneline(
+			"merge-base",
+			@$parents, $merge_tip,
+		       );
+
+		# double check that there are no missing non-merge commits
+		my (@incomplete) = check_cherry_pick(
+			$merge_base, $merge_tip,
+			@$ranges,
+		       );
+
+		if ( @incomplete ) {
+			warn "W:svn cherry-pick ignored ($spec) - missing "
+				.@incomplete." commit(s) (eg $incomplete[0])\n";
+		} else {
+			warn
+				"Found merge parent (svn:mergeinfo prop): ",
+					$merge_tip, "\n";
+			push @new_parents, $merge_tip;
+		}
+	}
+
+	# cater for merges which merge commits from multiple branches
+	if ( @new_parents > 1 ) {
+		for ( my $i = 0; $i <= $#new_parents; $i++ ) {
+			for ( my $j = 0; $j <= $#new_parents; $j++ ) {
+				next if $i == $j;
+				next unless $new_parents[$i];
+				next unless $new_parents[$j];
+				my $revs = command_oneline(
+					"rev-list", "-1", "$i..$j",
+				       );
+				if ( !$revs ) {
+					undef($new_parents[$i]);
+				}
 			}
 		}
 	}
+	push @$parents, grep { defined } @new_parents;
 }
 
 sub make_log_entry {
t/t9151-svn-mergeinfo.sh +2 -2
index f6e00ea..359eeaa 100755
@@ -15,13 +15,13 @@ test_expect_success 'load svn dump' "
 	git svn fetch --all
 	"
 
-test_expect_failure 'all svn merges became git merge commits' '
+test_expect_success 'all svn merges became git merge commits' '
 	unmarked=$(git rev-list --parents --all --grep=Merge |
 		grep -v " .* " | cut -f1 -d" ")
 	[ -z "$unmarked" ]
 	'
 
-test_expect_failure 'cherry picks did not become git merge commits' '
+test_expect_success 'cherry picks did not become git merge commits' '
 	bad_cherries=$(git rev-list --parents --all --grep=Cherry |
 		grep " .* " | cut -f1 -d" ")
 	[ -z "$bad_cherries" ]
Signature · 1 line
1.6.3.3
author
#6 lore raw

Re: [PATCH 2/5] git-svn: memoize conversion of SVN merge ticket info to git commit ranges

In reply to Sam Vilain
Quoted 5 lines · Sam Vilain

Each time the svn mergeinfo ticket changes, we look it up in the rev_map; when there are a lot of merged branches, this will result in many repeated lookups of the same information for subsequent commits. Arrange the slow part of the function so that it may be memoized, and memoize it. The more expensive revision walking operation can be memoized separately.

Sorry, that text was an old revision. Read as:

Each time the svn mergeinfo ticket changes, we look it up in the rev_map; when there are a lot of merged branches, this will result in many repeated lookups of the same information for subsequent commits. Arrange that part of the function so that it may be memoized, and memoize it.

Sam

author
#7 lore raw

Re: [PATCH 2/5] git-svn: memoize conversion of SVN merge ticket info to git commit ranges

In reply to Sam Vilain
Quoted 30 lines · Sam Vilain

Each time the svn mergeinfo ticket changes, we look it up in the rev_map; when there are a lot of merged branches, this will result in many repeated lookups of the same information for subsequent commits. Arrange the slow part of the function so that it may be memoized, and memoize it. The more expensive revision walking operation can be memoized separately.

---
 git-svn.perl |   91 ++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 54 insertions(+), 37 deletions(-)
git-svn.perl +4 -0
index a4b052c..3b17a83 100755
@@ -1634,6 +1634,7 @@ use Carp qw/croak/;
 use File::Path qw/mkpath/;
 use File::Copy qw/copy/;
 use IPC::Open3;
+use Memoize;  # core since 5.8.0, Jul 2002
 
 my ($_gc_nr, $_gc_period);
 
@@ -2967,6 +2968,55 @@ sub find_extra_svk_parents {
 	}
 }
 
+sub lookup_svn_merge {
+	my $uuid = shift;
+	my $url = shift;

git-svn.perl sub find_extra_svk_parents { · line 2983

Quoted 10 lines
git-svn.perl +10 -0
+	my $merge = shift;
+
+	my ($source, $revs) = split ":", $merge;
+	my $path = $source;
+	$path =~ s{^/}{};
+	my $gs = Git::SVN->find_by_url($url.$source, $url, $path);
+	if ( !$gs ) {
+		warn "Couldn't find revmap for $url$source\n";
+		next;
+	}

As mentioned in the other thread, that 'next' should now be 'return'.

Sam

#8 lore raw

Re: [PATCH 2/5] git-svn: memoize conversion of SVN merge ticket info to git commit ranges

Quoted 16 lines · Sam Vilain

Review

Quoted 13 lines · Sam Vilain
(quoted diff) +13 -0
+sub lookup_svn_merge {
+	my $uuid = shift;
+	my $url = shift;
+	my $merge = shift;
+
+	my ($source, $revs) = split ":", $merge;
+	my $path = $source;
+	$path =~ s{^/}{};
+	my $gs = Git::SVN->find_by_url($url.$source, $url, $path);
+	if ( !$gs ) {
+		warn "Couldn't find revmap for $url$source\n";
+		next;
+	}

As mentioned in the other thread, that 'next' should now be 'return'.

Thanks Sam and Andrew. I've acked this series and pushed them out along with a release notes update as well as another small fix (inline below).

Eric Wong (2):
git svn: fix --revision when fetching deleted paths update release notes for git svn in 1.6.6

Sam Vilain (5):
git-svn: expand the svn mergeinfo test suite, highlighting some failures
git-svn: memoize conversion of SVN merge ticket info to git commit ranges
git-svn: fix some mistakes with interpreting SVN mergeinfo commit ranges
git-svn: exclude already merged tips using one rev-list call
git-svn: detect cherry-picks correctly.

Quoted 1 line

From 577e9fcad2c8968846b365226b89778050496a78 Mon Sep 17 00:00:00 2001

From: Eric Wong <[email protected]>
Date: Mon, 21 Dec 2009 02:06:04 -0800
Subject: [PATCH] git svn: fix --revision when fetching deleted paths

When using the -r/--revision argument to fetch deleted history, calling SVN::Ra::get_log() from an SVN::Ra object initialized to track the deleted URL will fail.

This regression was introduced in:
commit 4aacaeb3dc82bb6479e70e120053dc27a399460e "fix shallow clone when upstream revision is too new"

We now ignore errors from SVN::Ra::get_log() here because using --revision will always override the value of $head here if (and only if) we're tracking deleted directories.

---
 git-svn.perl |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
git-svn.perl +5 -1
index d362de7..a6f5061 100755
@@ -1741,7 +1741,11 @@ sub fetch_all {
 	my $ra = Git::SVN::Ra->new($url);
 	my $uuid = $ra->get_uuid;
 	my $head = $ra->get_latest_revnum;
-	$ra->get_log("", $head, 0, 1, 0, 1, sub { $head = $_[1] });
+
+	# ignore errors, $head revision may not even exist anymore
+	eval { $ra->get_log("", $head, 0, 1, 0, 1, sub { $head = $_[1] }) };
+	warn "W: $@\n" if $@;
+
 	my $base = defined $fetch ? $head : 0;
 
 	# read the max revs for wildcard expansion (branches/*, tags/*)
Signature · 1 line
Eric Wong
author
#9 lore raw
In reply to Sam Vilain
Quoted 5 lines · Sam Vilain

This series implements some efficiency enhancements; particularly in dealing with repositories which have a single trunk branch which receives many merges of feature branches and/or cherry-picks. It also fixes a number of corner cases in the merge conversion code.

Quoted 8 lines

It would be nice if the people who have experienced slow git-svn performance in these situations could test that this fixes the performance issues, and that the resulting repositories seem to have correct contents.

Eric, I'm using Alex's trick of a single commit which adds failing tests - marked as _expect_failure - and then marked them as succeeding as the series progresses.

More useful info:

 git-svn.perl               |  220 +++++++++----
 t/t9151-svn-mergeinfo.sh   |   27 ++-
 t/t9151/make-svnmerge-dump |  166 ++++++---
 t/t9151/svn-mergeinfo.dump |  839
++++++++++++++++++++++++++++++++++++++------
 4 files changed, 1018 insertions(+), 234 deletions(-)

And available at git://github.com/samv/git (branch mergeinfo-fixes)

Sam

#10 lore raw
In reply to Sam Vilain
Quoted 4 lines

It would be nice if the people who have experienced slow git-svn performance in these situations could test that this fixes the performance issues, and that the resulting repositories seem to have correct contents.

I tried cloning from a fairly recent revision that I knew was after our switchover to svn 1.5, and I received a number of these errors:

Couldn't find revmap for [branch]
Exiting subroutine via next at /Users/adm/libexec/git-core/git-svn line 2983. Exiting subroutine via next at /Users/adm/libexec/git-core/git-svn line 2983. Exiting subroutine via next at /Users/adm/libexec/git-core/git-svn line 2983.

I'm not sure if this is expected, since I didn't clone from the whole repo, but it did cause a lot of spew. I'm starting a fresh clone now, but it takes a few days to get through the whole repository. I'm fairly new to git, so I would welcome any tips on how I can test this more quickly.

-Andrew

author
#11 lore raw
Quoted 8 lines · Andrew Myrick

I tried cloning from a fairly recent revision that I knew was after our switchover to svn 1.5, and I received a number of these errors:

Couldn't find revmap for [branch]
Exiting subroutine via next at /Users/adm/libexec/git-core/git-svn line 2983. Exiting subroutine via next at /Users/adm/libexec/git-core/git-svn line 2983. Exiting subroutine via next at /Users/adm/libexec/git-core/git-svn line 2983.

Quoted 5 lines

I'm not sure if this is expected, since I didn't clone from the whole repo, but it did cause a lot of spew. I'm starting a fresh clone now, but it takes a few days to get through the whole repository. I'm fairly new to git, so I would welcome any tips on how I can test this more quickly.

Whoops, no, not expected, I'll post a minor correction. That means that the branch which was merged in does not have git-svn metadata; ie, it's not being tracked explicitly. If people are doing merging of things which aren't roots of branches you would expect this. SVN, like Perforce, supports a confusing amount of flexibility in its merge tracking. If [branch] is a real branch, then you'll want to see why it doesn't have metadata yet. Is it really a sub-tree of a real branch? You could fetch it independently using a separate git-svn remote, or you could ignore the warning; it should be relatively self-evident what happened from the merge message and the contents of the changeset.

Note if your repository was significantly re-organized at any point, it will pay to treat each section of history as a separate import project, and stitch the results together afterwards using grafts and filter-branch.

This version should be *significantly* faster than the old one. ie, it should not take a minute per commit while importing the heavily merged-into integration branch. Possibly a few seconds at most.

Sam

#12 lore raw
Quoted 15 lines · Sam Vilain
Quoted 8 lines · Andrew Myrick

I tried cloning from a fairly recent revision that I knew was after our switchover to svn 1.5, and I received a number of these errors:

   Couldn't find revmap for [branch]
   Exiting subroutine via next at /Users/adm/libexec/git-core/git-svn line 2983. Exiting subroutine via next at /Users/adm/libexec/git-core/git-svn line 2983. Exiting subroutine via next at /Users/adm/libexec/git-core/git-svn line 2983.

Quoted 5 lines

I'm not sure if this is expected, since I didn't clone from the whole repo, but it did cause a lot of spew.  I'm starting a fresh clone now, but it takes a few days to get through the whole repository.  I'm fairly new to git, so I would welcome any tips on how I can test this more quickly.

Quoted 10 lines

Whoops, no, not expected, I'll post a minor correction.  That means that the branch which was merged in does not have git-svn metadata; ie, it's not being tracked explicitly.  If people are doing merging of things which aren't roots of branches you would expect this.  SVN, like Perforce, supports a confusing amount of flexibility in its merge tracking.  If [branch] is a real branch, then you'll want to see why it doesn't have metadata yet.  Is it really a sub-tree of a real branch? You could fetch it independently using a separate git-svn remote, or you could ignore the warning; it should be relatively self-evident what happened from the merge message and the contents of the changeset.

I think the problem is that I started fetching from a later revision than when the branch was created and reintegrated. There would be no metadata for the branch, so a lookup for it would fail. Fetching the branch explicitly, or fetching from r1 as my current test is doing, should not experience this problem.

Quoted 4 lines

Note if your repository was significantly re-organized at any point, it will pay to treat each section of history as a separate import project, and stitch the results together afterwards using grafts and filter-branch.

I don't believe it was, but I will keep that in mind if I run into trouble. The import from r1 went fine with git v1.6.5.*, and it's proceeding well now.

Quoted 3 lines

This version should be *significantly* faster than the old one.  ie, it should not take a minute per commit while importing the heavily merged-into integration branch.  Possibly a few seconds at most.

So far, most commits are fetched in under 3s with your new version.

Thanks for your help, Sam.

-Andrew