From: Sam Vilain <sam@vilain.net>
To: Michael Olson <mwolson@gnu.org>
Cc: git@vger.kernel.org, Eric Wong <normalperson@yhbt.net>,
Michael J Gruber <git@drmicha.warpmail.net>,
Tim Stoakes <tim@stoakes.net>
Subject: Re: [spf:guess,iffy,mismatch] Re: [PATCH/RFC 2/2] git-svn: Don't allow missing commit parent to stop git-svn
Date: Thu, 22 Apr 2010 11:45:11 +1200 [thread overview]
Message-ID: <4BCF8E07.9080507@vilain.net> (raw)
In-Reply-To: <m2sc8b3bef91004211417n1f3368a7ica94a1c2a7656622@mail.gmail.com>
Michael Olson wrote:
> Interestingly, I see people reporting the same problem in the thread
> "git svn clone of subversion's own code failing". So it's not just
> related to patch 1/2 of this series. At least that thread has a
> public-facing repo so the problem should be easier to reproduce for
> a real fix.
Oh, right ... I remember that issue now. I'm currently testing the
below change to see if it breaks the test suite; any issues and I'll
post an update.
Subject: [PATCH] git-svn: deal with svn cherry-picks with non-linear history
The expression 'BASE^..TIP' is only defined when BASE has parents. It
actually does what it intends only when it has one parent.
Allow for more complicated revision list arguments than a range by
splitting any space-containing arguments on the way into _rev_list,
and check the parents of the bottom commit so that we may use the
correct revision list specifier.
---
git-svn.perl | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 2c86ea2..a82ca1a 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3063,8 +3063,24 @@ sub lookup_svn_merge {
next;
}
- push @merged_commit_ranges,
- "$bottom_commit^..$top_commit";
+ # how many parents does $bottom_commit have?
+ my @parents = split / /, command_oneline(
+ qw(rev-list --parents -1 -m),
+ $bottom_commit,
+ );
+ shift @parents;
+
+ if ( @parents == 1 ) {
+ push @merged_commit_ranges,
+ "$bottom_commit^..$top_commit";
+ }
+ elsif ( @parents ) {
+ push @merged_commit_ranges,
+ "$top_commit --not @parents";
+ }
+ else {
+ push @merged_commit_ranges, $top_commit;
+ }
if ( !defined $tip or $top > $tip ) {
$tip = $top;
@@ -3094,7 +3110,7 @@ sub check_cherry_pick {
my %commits = map { $_ => 1 }
_rev_list("--no-merges", $tip, "--not", $base);
for my $range ( @ranges ) {
- delete @commits{_rev_list($range)};
+ delete @commits{_rev_list(split " ", $range)};
}
for my $commit (keys %commits) {
if (has_no_changes($commit)) {
--
1.7.0.2
next prev parent reply other threads:[~2010-04-22 0:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-20 21:30 [PATCH/RFC 2/2] git-svn: Don't allow missing commit parent to stop git-svn Michael Olson
2010-04-21 20:07 ` Sam Vilain
2010-04-21 21:17 ` Michael Olson
2010-04-21 23:45 ` Sam Vilain [this message]
2010-04-28 15:51 ` [spf:guess,iffy,mismatch] " Michael Olson
2010-05-03 21:19 ` Eric Wong
2010-05-04 6:40 ` Michael J Gruber
2010-05-04 18:34 ` Eric Wong
2010-05-04 22:02 ` Sam Vilain
2010-05-04 23:16 ` Eric Wong
2010-05-19 21:17 ` Michael Olson
2010-05-19 21:19 ` Michael Olson
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=4BCF8E07.9080507@vilain.net \
--to=sam@vilain.net \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=mwolson@gnu.org \
--cc=normalperson@yhbt.net \
--cc=tim@stoakes.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.