git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Myrick <amyrick@apple.com>
To: git@vger.kernel.org
Cc: sam@vilain.net, normalperson@yhbt.net, Andrew Myrick <amyrick@apple.com>
Subject: [PATCH 2/2] git-svn: handle merge-base failures
Date: Wed, 06 Jan 2010 12:08:49 -0800	[thread overview]
Message-ID: <1262808529-1575-2-git-send-email-amyrick@apple.com> (raw)
In-Reply-To: <1262808529-1575-1-git-send-email-amyrick@apple.com>

Change git-svn to warn and continue when merge-base fails while processing svn
merge tickets.

merge-base can fail when a partial branch is created and merged back to trunk
in svn, because it cannot find a common ancestor between the partial branch and
trunk.

Signed-off-by: Andrew Myrick <amyrick@apple.com>
---
 git-svn.perl |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 8c7c034..d58982b 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3158,10 +3158,21 @@ sub find_extra_svn_parents {
 		my $ranges = $ranges{$merge_tip};
 
 		# check out 'new' tips
-		my $merge_base = command_oneline(
-			"merge-base",
-			@$parents, $merge_tip,
-		       );
+                my $merge_base;
+                eval {
+                        $merge_base = command_oneline(
+                                "merge-base",
+                                @$parents, $merge_tip,
+                               );
+                };
+                if ($@) {
+                        die "An error occurred during merge-base"
+                            unless $@->isa("Git::Error::Command");
+
+                        warn "W: Cannot find common ancestor between ".
+                            "@$parents and $merge_tip. Ignoring merge info.\n";
+                        next;
+                }
 
 		# double check that there are no missing non-merge commits
 		my (@incomplete) = check_cherry_pick(
-- 
1.6.6.2.g18c9a

  reply	other threads:[~2010-01-06 20:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-06 20:08 [PATCH 1/2] git-svn: ignore changeless commits when checking for a cherry-pick Andrew Myrick
2010-01-06 20:08 ` Andrew Myrick [this message]
2010-01-06 21:43 ` Eric Wong
2010-01-06 22:38   ` [spf:guess] " Sam Vilain
2010-01-07  6:49     ` Eric Wong
2010-01-07  9:05       ` [spf:guess] " Sam Vilain
2010-01-06 22:52   ` Andrew Myrick
2010-01-07  0:25     ` Andrew Myrick
2010-01-07  0:25       ` [PATCH 2/2] git-svn: handle merge-base failures Andrew Myrick
2010-01-07  9:50       ` [PATCH 1/2] git-svn: ignore changeless commits when checking for a cherry-pick Eric Wong
2010-01-21 21:55     ` [PATCH] git-svn: update svn mergeinfo test suite Andrew Myrick

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=1262808529-1575-2-git-send-email-amyrick@apple.com \
    --to=amyrick@apple.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).