threads / patch / 24949

patchgit-svn: check_cherry_pick should exclude commits already in our history

Subject: [PATCH] git-svn: check_cherry_pick should exclude commits already in our history

## tl;dr

3 messages between Sep 2, 2010 and Sep 2, 2010. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Steven Walter· Sep 2, 2010, 16:46 UTC · lore
From: Steven Walter <swalter@lpdev.prtdev.lexmark.com>
The merge-base between @$parents and $merge_tip may have been reached
through a merge commit.  This means that some commits that are ancestors
of @$parents will not be ancestors of $merge_base.  The mergeinfo
property will not list commits that are ancestors of @$parents, so we
need to explicitly exclude them.
---
 git-svn.perl |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Show changes to git-svn.perl +3 −1
diff --git a/git-svn.perl b/git-svn.perl
index 7a72f75..70edf80 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3087,9 +3087,10 @@ sub _rev_list {
 sub check_cherry_pick {
 	my $base = shift;
 	my $tip = shift;
+	my $parents = shift;
 	my @ranges = @_;
 	my %commits = map { $_ => 1 }
-		_rev_list("--no-merges", $tip, "--not", $base);
+		_rev_list("--no-merges", $tip, "--not", $base, @$parents);
 	for my $range ( @ranges ) {
 		delete @commits{_rev_list($range)};
 	}
@@ -3249,6 +3250,7 @@ sub find_extra_svn_parents {
 		# double check that there are no missing non-merge commits
 		my (@incomplete) = check_cherry_pick(
 			$merge_base, $merge_tip,
+			$parents,
 			@$ranges,
 		       );
 
-- 
1.7.0.5.gbc75a
Eric Wong· Sep 2, 2010, 21:47 UTC · re: Steven Walter · lore

Re: [PATCH] git-svn: check_cherry_pick should exclude commits already in our history

Steven Walter <stevenrwalter@gmail.com> wrote:
Show 7 quoted lines
> From: Steven Walter <swalter@lpdev.prtdev.lexmark.com>
> 
> The merge-base between @$parents and $merge_tip may have been reached
> through a merge commit.  This means that some commits that are ancestors
> of @$parents will not be ancestors of $merge_base.  The mergeinfo
> property will not list commits that are ancestors of @$parents, so we
> need to explicitly exclude them.
Thanks Steven, looks reasonable to me.  Sign-off?
Sam: any objections?
Acked-by: Eric Wong <normalperson@yhbt.net>
Show 29 quoted lines
> ---
>  git-svn.perl |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/git-svn.perl b/git-svn.perl
> index 7a72f75..70edf80 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -3087,9 +3087,10 @@ sub _rev_list {
>  sub check_cherry_pick {
>  	my $base = shift;
>  	my $tip = shift;
> +	my $parents = shift;
>  	my @ranges = @_;
>  	my %commits = map { $_ => 1 }
> -		_rev_list("--no-merges", $tip, "--not", $base);
> +		_rev_list("--no-merges", $tip, "--not", $base, @$parents);
>  	for my $range ( @ranges ) {
>  		delete @commits{_rev_list($range)};
>  	}
> @@ -3249,6 +3250,7 @@ sub find_extra_svn_parents {
>  		# double check that there are no missing non-merge commits
>  		my (@incomplete) = check_cherry_pick(
>  			$merge_base, $merge_tip,
> +			$parents,
>  			@$ranges,
>  		       );
>  
> -- 
Steven Walter· Sep 2, 2010, 22:32 UTC · re: Eric Wong · lore
From: Steven Walter <swalter@lpdev.prtdev.lexmark.com>

The merge-base between @$parents and $merge_tip may have been reached through a merge commit. This means that some commits that are ancestors of @$parents will not be ancestors of $merge_base. The mergeinfo property will not list commits that are ancestors of @$parents, so we need to explicitly exclude them.

Signed-off-by: Steven Walter <stevenrwalter@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
---
 git-svn.perl |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Show changes to git-svn.perl +3 −1
diff --git a/git-svn.perl b/git-svn.perl
index 9b046b6..c7c4dcd 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3118,9 +3118,10 @@ sub _rev_list {
 sub check_cherry_pick {
 	my $base = shift;
 	my $tip = shift;
+	my $parents = shift;
 	my @ranges = @_;
 	my %commits = map { $_ => 1 }
-		_rev_list("--no-merges", $tip, "--not", $base);
+		_rev_list("--no-merges", $tip, "--not", $base, @$parents);
 	for my $range ( @ranges ) {
 		delete @commits{_rev_list($range)};
 	}
@@ -3296,6 +3297,7 @@ sub find_extra_svn_parents {
 		# double check that there are no missing non-merge commits
 		my (@incomplete) = check_cherry_pick(
 			$merge_base, $merge_tip,
+			$parents,
 			@$ranges,
 		       );
 
-- 
1.7.0.4

← back to recent threads