summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2012-02-17 18:36:55 +0100
committerNicholas Clark <nick@ccl4.org>2012-02-17 21:03:39 +0100
commit03cc0342a54fbc33ac400c1b56af9a942aae2ea4 (patch)
treeef0662e22b0866ffb98c3ab43860a39fe6df90c6
parentfd3bef80244f3478e9ab9ef909bcac4f471fc51e (diff)
downloadperl-03cc0342a54fbc33ac400c1b56af9a942aae2ea4.tar.gz
bisect.pl now reports a meaningful error for certain "can't start" scenarios.
If --end is specified but not --start, then don't probe for start revisions that are more recent than the --end. Previously bisect.pl would test all stable revisions for a start point, and if it happened to find a (seemingly) valid start point, it would continue on to run git bisect, which would fail with the error: Some good revs are not ancestor of the bad rev. git bisect cannot work properly in this case. Maybe you mistake good and bad revs? which doesn't make clear what the problem actually is. Now the error is: Can't find a suitable start revision to default to. Tried perl-5.002 perl-5.003 perl-5.004 perl-5.005 perl-5.6.0 at ...
-rwxr-xr-xPorting/bisect.pl11
1 files changed, 10 insertions, 1 deletions
diff --git a/Porting/bisect.pl b/Porting/bisect.pl
index 1a51405491..da197213c5 100755
--- a/Porting/bisect.pl
+++ b/Porting/bisect.pl
@@ -121,15 +121,24 @@ if (defined $start) {
die "Runner returned $ret, not 0 for start revision" if $ret;
} else {
# Try to find the earliest version for which the test works
+ my @tried;
foreach my $try (@stable) {
+ if (`git rev-list -n1 $end ^$try^` eq "") {
+ print "Skipping $try, as it is more recent than end commit "
+ . (substr $end, 0, 16) . "\n";
+ # As @stable is supposed to be in age order, arguably we should
+ # last; here.
+ next;
+ }
system "git checkout $try" and die;
my $ret = system $^X, $runner, @ARGV;
if (!$ret) {
$start = $try;
last;
}
+ push @tried, $try;
}
- die "Can't find a suitable start revision to default to. Tried @stable"
+ die "Can't find a suitable start revision to default to.\nTried @tried"
unless defined $start;
}