NAME
Dist::Zilla::Util::Git::Tags - Extract all tags from a repository
VERSION
version 0.004000
SYNOPSIS
This tool basically gives a more useful interface around
git tag
Namely, each tag returned is a tag object, and you can view tag
properties with it.
use Dist::Zilla::Util::Git::Tags;
my $tags_finder = Dist::Zilla::Util::Git::Tags->new(
zilla => $self->zilla
);
for my $tag ( $tags_finder->tags ) {
printf "%s - %s\n", $tag->name, $tag->sha1;
}
METHODS
"tags"
A "List" of "::Tags::Tag" objects
my @tags = $tag_finder->tags();
"get_tag"
my ($first_matching) = $tags->get_tag('1.000');
my (@all_matching) = $tags->get_tag('1.*');
Note: This can easily return multiple values.
For instance, "tags" is implemented as
my ( @tags ) = $branches->get_tag('*');
Mostly, because the underlying mechanism is implemented in terms of
fnmatch(3)
If the tag does not exist, or no tag match the expression, "get_tag"
will return an empty list.
So in the top example, "match" is "undef" if 1.000 does not exist.
"tag_sha1_map"
A "HashRef" of "sha1 => [ tag, tag ]" entries.
my $hash = $tag_finder->tag_sha1_map();
"tags_for_rev"
A "List" of "::Tags::Tag" objects that point to the given "SHA1".
$tag_finder->tags_for_rev( $sha1_or_commitish_etc );
ATTRIBUTES
"refs"
A Dist::Zilla::Util::Git::Refs instance, auto-built if not specified.
AUTHOR
Kent Fredric <kentfredric@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Kent Fredric
<kentfredric@gmail.com>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.