Functions
2.1 Annotated Commit
2.2 Blame
2.3 Blob
2.4 Branch
2.5 Buffer
2.6 Checkout
2.7 Cherrypick
2.8 Clone
2.9 Commit
2.10 Config
2.11 Credentials
2.12 Describe
2.13 Diff
2.14 Fetch
2.15 Filter
2.16 Errors
2.17 Graph
2.18 Ignore
2.19 Index
2.20 Indexer
2.21 Global
2.22 Merge
2.23 Message
2.24 Note
2.25 Object
2.26 Object Database
2.27 Oid
2.28 Oid Array
2.29 Packbuilder
2.30 Patch
2.31 Pathspec
2.32 Proxy
2.33 Push
2.34 Rebase
2.35 Refdb
2.36 Reference
2.37 Reflog
2.38 Refspec
2.39 Remote
2.40 Repository
2.41 Reset
2.42 Revert
2.43 Revparse
2.44 Revwalk
2.45 Signature
2.46 Stash
2.47 Status
2.48 Strarray
2.49 Submodule
2.50 Tag
2.51 Tree
2.52 Treebuilder
On this page:
git_  tag_  annotation_  create
git_  tag_  create
git_  tag_  create_  frombuffer
git_  tag_  create_  lightweight
git_  tag_  delete
git_  tag_  dup
git_  tag_  foreach
git_  tag_  free
git_  tag_  id
git_  tag_  list
git_  tag_  list_  match
git_  tag_  lookup
git_  tag_  lookup_  prefix
git_  tag_  message
git_  tag_  name
git_  tag_  owner
git_  tag_  peel
git_  tag_  tagger
git_  tag_  target
git_  tag_  target_  id
git_  tag_  target_  type
8.6

2.50 Tag

 (require libgit2/include/tag) package: libgit2

procedure

(git_tag_annotation_create oid    
  repo    
  tag_name    
  target    
  tagger    
  message)  integer?
  oid : oid?
  repo : repository?
  tag_name : string?
  target : object?
  tagger : signature?
  message : string?
Create a new tag in the object database pointing to a git_object

The message will not be cleaned up. This can be achieved through git_message_prettify().

procedure

(git_tag_create oid    
  repo    
  tag_name    
  target    
  tagger    
  message    
  force)  integer?
  oid : oid?
  repo : repository?
  tag_name : string?
  target : object?
  tagger : signature?
  message : string?
  force : boolean?
Create a new tag in the repository from an object

A new reference will also be created pointing to this tag object. If force is true and a reference already exists with the given name, it’ll be replaced.

The message will not be cleaned up. This can be achieved through git_message_prettify().

The tag name will be checked for validity. You must avoid the characters ’~’, ’^’, ’:’, ’\’, ’?’, ’[’, and ’*’, and the sequences ".." and @{ which have special meaning to revparse.

procedure

(git_tag_create_frombuffer oid    
  repo    
  buffer    
  force)  integer?
  oid : oid?
  repo : repository?
  buffer : string?
  force : boolean?
Create a new tag in the repository from a buffer

procedure

(git_tag_create_lightweight oid    
  repo    
  tag_name    
  target    
  force)  integer?
  oid : oid?
  repo : repository?
  tag_name : string?
  target : object?
  force : boolean?
Create a new lightweight tag pointing at a target object

A new direct reference will be created pointing to this target object. If force is true and a reference already exists with the given name, it’ll be replaced.

The tag name will be checked for validity. See git_tag_create() for rules about valid names.

procedure

(git_tag_delete repo tag_name)  integer?

  repo : repository?
  tag_name : string?
Delete an existing tag reference.

The tag name will be checked for validity. See git_tag_create() for rules about valid names.

procedure

(git_tag_dup source)  tag?

  source : tag?
Create an in-memory copy of a tag. The copy must be explicitly free’d or it will leak.

procedure

(git_tag_foreach repo callback payload)  integer?

  repo : repository?
  callback : git_tag_foreach_cb
  payload : bytes?
Call callback ‘cb’ for each tag in the repository

procedure

(git_tag_free tag)  void?

  tag : tag?
Close an open tag

You can no longer use the git_tag pointer after this call.

IMPORTANT: You MUST call this method when you are through with a tag to release memory. Failure to do so will cause a memory leak.

procedure

(git_tag_id tag)  oid?

  tag : tag?
Get the id of a tag.

procedure

(git_tag_list tag_names repo)  integer?

  tag_names : strarray?
  repo : repository?
Fill a list with all the tags in the Repository

The string array will be filled with the names of the matching tags; these values are owned by the user and should be free’d manually when no longer needed, using git_strarray_free.

procedure

(git_tag_list_match tag_names pattern repo)  integer?

  tag_names : strarray?
  pattern : string?
  repo : repository?
Fill a list with all the tags in the Repository which name match a defined pattern

If an empty pattern is provided, all the tags will be returned.

The string array will be filled with the names of the matching tags; these values are owned by the user and should be free’d manually when no longer needed, using git_strarray_free.

procedure

(git_tag_lookup repo id)  tag?

  repo : repository?
  id : oid?
Lookup a tag object from the repository.

procedure

(git_tag_lookup_prefix repo id len)  tag?

  repo : repository?
  id : oid?
  len : integer?
Lookup a tag object from the repository, given a prefix of its identifier (short id).

procedure

(git_tag_message tag)  string?

  tag : tag?
Get the message of a tag

procedure

(git_tag_name tag)  string?

  tag : tag?
Get the name of a tag

procedure

(git_tag_owner tag)  repository?

  tag : tag?
Get the repository that contains the tag.

procedure

(git_tag_peel tag)  object?

  tag : tag?
Recursively peel a tag until a non tag git_object is found

The retrieved tag_target object is owned by the repository and should be closed with the git_object_free method.

procedure

(git_tag_tagger tag)  signature?

  tag : tag?
Get the tagger (author) of a tag

procedure

(git_tag_target tag)  object?

  tag : tag?
Get the tagged object of a tag

This method performs a repository lookup for the given object and returns it

procedure

(git_tag_target_id tag)  oid?

  tag : tag?
Get the OID of the tagged object of a tag

procedure

(git_tag_target_type tag)  git_otype

  tag : tag?
Get the type of a tag’s tagged object