git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tuomas Suutari <tuomas.suutari@gmail.com>
To: git@vger.kernel.org
Cc: Tuomas Suutari <tuomas.suutari@gmail.com>,
	Sam Vilain <sam@vilain.net>, Eric Wong <normalperson@yhbt.net>
Subject: [PATCH 3/3] git-svn: Fix discarding of extra parents from svn:mergeinfo
Date: Mon, 22 Feb 2010 09:57:22 +0200	[thread overview]
Message-ID: <1266825442-32107-4-git-send-email-tuomas.suutari@gmail.com> (raw)
In-Reply-To: <1266825442-32107-1-git-send-email-tuomas.suutari@gmail.com>

Use merge-base rather than rev-list for detecting if a parent is an
ancestor of another, because rev-list gives incorrect results
sometimes.

Signed-off-by: Tuomas Suutari <tuomas.suutari@gmail.com>
---
 git-svn.perl             |    8 ++++----
 t/t9151-svn-mergeinfo.sh |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 265852f..1e2bbe5 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3268,11 +3268,11 @@ sub find_extra_svn_parents {
 				next if $i == $j;
 				next unless $new_parents[$i];
 				next unless $new_parents[$j];
-				my $revs = command_oneline(
-					"rev-list", "-1",
-					"$new_parents[$i]..$new_parents[$j]",
+				my $mergebase = command_oneline(
+					"merge-base",
+					"$new_parents[$i]", "$new_parents[$j]",
 				       );
-				if ( !$revs ) {
+				if ( $mergebase eq $new_parents[$i] ) {
 					undef($new_parents[$i]);
 				}
 			}
diff --git a/t/t9151-svn-mergeinfo.sh b/t/t9151-svn-mergeinfo.sh
index 353f543..1640824 100755
--- a/t/t9151-svn-mergeinfo.sh
+++ b/t/t9151-svn-mergeinfo.sh
@@ -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 'commit made to merged branch is reachable from the merge' '
+test_expect_success 'commit made to merged branch is reachable from the merge' '
 	before_commit=$(git rev-list --all --grep="trunk commit before merging trunk to b2")
 	merge_commit=$(git rev-list --all --grep="Merge trunk to b2")
 	not_reachable=$(git rev-list -1 $before_commit --not $merge_commit)
-- 
1.7.0.86.g7501

  parent reply	other threads:[~2010-02-22  7:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-22  7:57 git-svn detects some merges incorrectly from svn:mergeinfo Tuomas Suutari
2010-02-22  7:57 ` [PATCH 1/3] t9151: Fix a few commits in the SVN dump Tuomas Suutari
2010-02-24 23:14   ` Sam Vilain
2010-02-22  7:57 ` [PATCH 2/3] t9151: Add two new svn:mergeinfo test cases Tuomas Suutari
2010-02-22  7:57 ` Tuomas Suutari [this message]
2010-02-22  9:57   ` [PATCH 3/3] git-svn: Fix discarding of extra parents from svn:mergeinfo Thomas Rast
2010-02-22 18:04     ` Tuomas Suutari
2010-02-22 18:12   ` [PATCH 3/3 v2] " Tuomas Suutari
2010-02-23 16:58     ` Thomas Rast
2010-02-26  9:50 ` git-svn detects some merges incorrectly " Eric Wong

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

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

  git send-email \
    --in-reply-to=1266825442-32107-4-git-send-email-tuomas.suutari@gmail.com \
    --to=tuomas.suutari@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=normalperson@yhbt.net \
    --cc=sam@vilain.net \
    /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.
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 NNTP newsgroup(s).