Skip to content

Commit 18a174c

Browse files
committed
Ask for tags directly
Otherwise git can list several tags on the same line (if they point to the same commit), and this breaks reasonable expectations. Also resolves a TODO.
1 parent bbcba70 commit 18a174c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/Whateverable.pm6

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -446,13 +446,12 @@ method get-commits($_, :$repo=$RAKUDO) {
446446
method get-tags($date, :$repo=$RAKUDO, :$dups=False, :@default=(HEAD,)) {
447447
my @tags = @default;
448448
my %seen;
449-
for get-output(cwd => $repo, git, log, --pretty="%d",
450-
--tags, --no-walk, --since=$date)<output>.lines -> $tag {
451-
next unless $tag ~~ /:i ‘tag:’ \s* ((\d\d\d\d\.\d\d)[\.\d\d?]?) /; # TODO use tag -l
452-
next if %seen{$0[0]}++;
453-
@tags.push($0)
449+
for get-output(cwd => $repo, <git tag -l>)<output>.lines.reverse -> $tag {
450+
next unless $tag ~~ /^(\d\d\d\d\.\d\d)[\.\d\d?]?$/;
451+
next if Date.new($date) after Date.new($0.trans(.=>-)~-20);
452+
next if $dups.not && %seen{~$0}++;
453+
@tags.push(~$tag)
454454
}
455-
456455
@tags.reverse
457456
}
458457

0 commit comments

Comments
 (0)