From 7f39e2df44ff4f42bbd6e224263af35f7e008a99 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Fri, 6 Jul 2012 17:35:08 +0200 Subject: [PATCH] If there is no 'blead' branch, bisect.pl now uses a suitable alternative. If HEAD is more recent than the last stable release (ie the latter is reachable from the former), HEAD is used for the bisect end, otherwise the last stable tag is used (and that release removed from the list of potential starts to try). --- Porting/bisect.pl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Porting/bisect.pl b/Porting/bisect.pl index 14ee602..db08f4c 100755 --- a/Porting/bisect.pl +++ b/Porting/bisect.pl @@ -76,7 +76,19 @@ 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; +if (!defined $end) { + # If we have a branch blead, use that as the end + $end = `git rev-parse --verify --quiet blead`; + die unless defined $end; + if (!length $end) { + # Else use whichever is newer - HEAD, or the most recent stable tag. + if (`git rev-list -n1 HEAD ^$stable[-1]` eq "") { + $end = pop @stable; + } else { + $end = 'HEAD'; + } + } +} # Canonicalising branches to revisions before moving the checkout permits one # to use revisions such as 'HEAD' for --start or --end -- 1.8.3.1