diff --git a/Porting/cmpVERSION.pl b/Porting/cmpVERSION.pl index 525ffe1d6fe..67fb926b83d 100755 --- a/Porting/cmpVERSION.pl +++ b/Porting/cmpVERSION.pl @@ -37,10 +37,16 @@ my $null = devnull(); unless (defined $tag_to_compare) { + my $check = 'HEAD'; + while(1) { + $check = `git describe --abbrev=0 $check 2>$null`; + chomp $check; + last unless $check =~ /-RC/; + $check .= '^'; + } + $tag_to_compare = $check; # Thanks to David Golden for this suggestion. - $tag_to_compare = `git describe --abbrev=0 2>$null`; - chomp $tag_to_compare; } unless (length $tag_to_compare) {