This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
bisect.pl should still print the time taken if it fails.
authorNicholas Clark <nick@ccl4.org>
Fri, 30 Sep 2011 06:06:35 +0000 (08:06 +0200)
committerNicholas Clark <nick@ccl4.org>
Fri, 30 Sep 2011 06:06:35 +0000 (08:06 +0200)
(Bisect runs can legitimately return failure for various reasons, such as if
"There are only 'skip'ped commits left to test.")

Add an editor block, and convert the only tabs to spaces.

Porting/bisect.pl

index bc462aa..2e2675e 100755 (executable)
@@ -11,14 +11,14 @@ sub usage {
 
 my %options;
 unless(GetOptions(\%options,
-                 'start=s',
-                 'end=s',
-                 'target=s',
-                 'jobs|j=i',
-                 'expect-pass=i',
-                 'expect-fail',
-                 'one-liner|e=s',
-                )) {
+                  'start=s',
+                  'end=s',
+                  'target=s',
+                  'jobs|j=i',
+                  'expect-pass=i',
+                  'expect-fail',
+                  'one-liner|e=s',
+                 )) {
     usage();
 }
 
@@ -65,6 +65,16 @@ system "git bisect bad $end" and die;
 # And now get git bisect to do the hard work:
 system 'git', 'bisect', 'run', $^X, $runner, @ARGS and die;
 
-my $end_time = time;
+END {
+    my $end_time = time;
 
-printf "That took %d seconds\n", $end_time - $start_time;
+    printf "That took %d seconds\n", $end_time - $start_time
+        if defined $start_time;
+}
+
+# Local variables:
+# cperl-indent-level: 4
+# indent-tabs-mode: nil
+# End:
+#
+# ex: set ts=8 sts=4 sw=4 et: