In bisect.pl, use --start and --end to give ranges to --validate
authorNicholas Clark <nick@ccl4.org>
Tue, 1 Nov 2011 19:48:30 +0000 (20:48 +0100)
committerNicholas Clark <nick@ccl4.org>
Tue, 1 Nov 2011 21:22:57 +0000 (22:22 +0100)
This allows the user to specify a subset of revisions to test build.

Porting/bisect-runner.pl
Porting/bisect.pl

index 7f9de33..a701aa4 100755 (executable)
@@ -387,9 +387,10 @@ Passing this to F<bisect.pl> will likely cause the bisect to fail badly.
 
 --validate
 
-Test that all stable revisions can be built. Attempts to build I<blead>,
-I<v5.14.0> .. I<perl-5.002>. Stops at the first failure, without cleaning
-the checkout. Ignores I<--start> and I<--end>. Useful for validating a new
+Test that all stable revisions can be built. By default, attempts to build
+I<blead>, I<v5.14.0> .. I<perl-5.002>. Stops at the first failure, without
+cleaning the checkout. Use I<--start> to specify the earliest revision to
+test, I<--end> to specify the most recent. Useful for validating a new
 OS/CPU/compiler combination. For example
 
     ../perl/Porting/bisect.pl --validate -e'print "Hello from $]\n"'
index 8a6b5df..d49223d 100755 (executable)
@@ -49,6 +49,14 @@ die "This checkout is not clean - $modified modified or untracked file(s)"
 
 sub validate {
     my $commit = shift;
+    if (defined $start && `git rev-list -n1 $commit ^$start^` eq "") {
+        print "Skipping $commit, as it is earlier than $start\n";
+        return;
+    }
+    if (defined $end && `git rev-list -n1 $end ^$commit^` eq "") {
+        print "Skipping $commit, as it is more recent than $end\n";
+        return;
+    }
     print "Testing $commit...\n";
     system "git checkout $commit </dev/null" and die;
     my $ret = system $^X, $runner, '--no-clean', @ARGV;