Skip to content

Commit

Permalink
fix: version fetched from only digital git tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Insomnia1437 authored and jerzyjamroz committed Apr 12, 2024
1 parent b580ad8 commit a45897e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions mrfCommon/src/genVersionHeader.pl
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,19 @@
}
if(!$foundvcs && -d "$opt_t/.git") {
# same format as Mercurial
$result = `git --git-dir="$opt_t/.git" describe --tags --dirty`;
chomp($result);
if(!$? && length($result)>1) {
$opt_V = $result;
my @tags = `git --git-dir="$opt_t/.git" tag --sort=-creatordate`;

my $valid_tag;
# find first tag which starts from number
foreach my $tag (@tags) {
chomp($tag);
if ($tag =~ /^\d/) {
$valid_tag = $tag;
last;
}
}
if (!$? && defined $valid_tag && length($valid_tag) > 1) {
$opt_V = $valid_tag;
$foundvcs = 1;
}
}
Expand Down

0 comments on commit a45897e

Please sign in to comment.