Add --gold option to bisect.pl for the revision to use for "recent" files.
authorNicholas Clark <nick@ccl4.org>
Fri, 6 Jul 2012 15:00:35 +0000 (17:00 +0200)
committerNicholas Clark <nick@ccl4.org>
Tue, 28 May 2013 07:19:29 +0000 (09:19 +0200)
Historically when bisect-runner.pl wanted to check out a known good recent
version of a file (such as makedepend.SH) it would check out the revision
from blead. However, that may not be wise as blead isn't guaranteed always to
be stable and therefore "known good". So default to using the most recent
tagged stable release.

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

index 89db0e4..7253f3c 100755 (executable)
@@ -62,7 +62,8 @@ unless(GetOptions(\%options,
                   },
                   'force-manifest', 'force-regen', 'test-build', 'validate',
                   'all-fixups', 'early-fixup=s@', 'late-fixup=s@', 'valgrind',
-                  'check-args', 'check-shebang!', 'usage|help|?', 'A=s@',
+                  'check-args', 'check-shebang!', 'usage|help|?', 'gold=s',
+                  'A=s@',
                   'D=s@' => sub {
                       my (undef, $val) = @_;
                       if ($val =~ /\A([^=]+)=(.*)/s) {
@@ -603,6 +604,14 @@ run C<../perl/Porting/bisect.pl /usr/bin/perl ~/test/testcase.pl>
 
 =item *
 
+--gold
+
+Revision to use when checking out known-good recent versions of files,
+such as F<makedepend.SH>. F<bisect-runner.pl> defaults this to I<blead>,
+but F<bisect.pl> will default it to the most recent stable release.
+
+=item *
+
 --usage
 
 =item *
@@ -904,7 +913,7 @@ sub revert_commit {
 
 sub checkout_file {
     my ($file, $commit) = @_;
-    $commit ||= 'blead';
+    $commit ||= $options{gold} || 'blead';
     system "git show $commit:$file > $file </dev/null"
         and die_255("Could not extract $file at revision $commit");
 }
index 0423fd3..14ee602 100755 (executable)
@@ -11,9 +11,9 @@ Documentation for this is in bisect-runner.pl
 # Which isn't what we want.
 use Getopt::Long qw(:config pass_through no_auto_abbrev);
 
-my ($start, $end, $validate, $usage, $bad, $jobs, $make);
+my ($start, $end, $validate, $usage, $bad, $jobs, $make, $gold);
 $bad = !GetOptions('start=s' => \$start, 'end=s' => \$end,
-                   'jobs|j=i' => \$jobs, 'make=s' => \$make,
+                   'jobs|j=i' => \$jobs, 'make=s' => \$make, 'gold=s' => \$gold,
                    validate => \$validate, 'usage|help|?' => \$usage);
 unshift @ARGV, '--help' if $bad || $usage;
 unshift @ARGV, '--validate' if $validate;
@@ -74,6 +74,8 @@ unshift @stable, qw(perl-5.005 perl-5.6.0 perl-5.8.0);
     }
 }
 
+unshift @ARGV, '--gold', defined $gold ? $gold : $stable[-1];
+
 $end = 'blead' unless defined $end;
 
 # Canonicalising branches to revisions before moving the checkout permits one