Dist::Zilla::Util::Git::Tags - Extract all tags from a repository
version 0.004000
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; }
tags
A List of ::Tags::Tag objects
List
::Tags::Tag
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)
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.
match
undef
1.000
tag_sha1_map
A HashRef of sha1 => [ tag, tag ] entries.
HashRef
sha1 => [ tag, tag ]
my $hash = $tag_finder->tag_sha1_map();
tags_for_rev
A List of ::Tags::Tag objects that point to the given SHA1.
SHA1
$tag_finder->tags_for_rev( $sha1_or_commitish_etc );
refs
A Dist::Zilla::Util::Git::Refs instance, auto-built if not specified.
Kent Fredric <kentfredric@gmail.com>
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.
To install Dist::Zilla::Util::Git::Tags, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Zilla::Util::Git::Tags
CPAN shell
perl -MCPAN -e shell install Dist::Zilla::Util::Git::Tags
For more information on module installation, please visit the detailed CPAN module installation guide.