NAME
Git::Native::Tag - A libgit2 annotated tag
VERSION
version 0.005
SYNOPSIS
my $tag = $repo->tag('v1.0.0');
say $tag->name; # 'v1.0.0'
say $tag->message; # tagger message
say $tag->target_id->hex;
DESCRIPTION
Wraps a libgit2 annotated tag object. Lightweight tags are plain refs under refs/tags/* and don't get a Tag wrapper - look them up with "reference" in Git::Native::Repository instead.
Everything in this class is therefore annotated-tag only: a lightweight tag has no tag object to carry a name, a message or a tagger. "tag" in Git::Native::Repository returns undef for one rather than dying, so a undef result means "no annotated tag under that name", not "no such tag" — "tag_names" in Git::Native::Repository lists both kinds. A Tag keeps its repository alive for as long as it is in scope.
name
say $tag->name; # 'v1.0.0'
The tag's short name, without the refs/tags/ prefix.
message
print $tag->message;
The tagger's message, as stored — including the trailing newline, and the PGP signature block for a signed tag.
target_id
say $tag->target_id;
The Git::Native::Oid of the object the tag points at, usually a commit. This is one step of peeling: the tag's own OID (the one refs/tags/v1.0.0 resolves to) is a different object, and a tag pointing at another tag needs another step.
SEE ALSO
Git::Native::Repository, Git::Native::Reference
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-git-native/issues.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <getty@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.