layout
default
menu_item
api
title
Tag
description
Version 0.19.0
return_to
API Documentation Index
/api/
sections
annotationCreate
create
createLightweight
delete
list
listMatch
lookup
lookupPrefix
#dup
#free
#id
#message
#name
#owner
#peel
#tagger
#target
#targetId
#targetType
#annotationCreate
#create
#createLightweight
#delete
#list
#listMatch
#lookup
#lookupPrefix
#dup
#free
#id
#message
#name
#owner
#peel
#tagger
#target
#targetId
#targetType
Tag. annotationCreate Async
Tag . annotationCreate ( repo , tag_name , target , tagger , message ) . then ( function ( oid ) {
// Use oid
} ) ;
Parameters
Type
repo
Repository
Repository where to store the tag
tag_name
String
Name for the tag
target
Object
Object to which this tag points. This object must belong to the given repo.
tagger
Signature
Signature of the tagger for this tag, and of the tagging time
message
String
Full message for this tag
Returns
Oid
the OID of the
newly created tag
Tag . create ( repo , tag_name , target , tagger , message , force ) . then ( function ( oid ) {
// Use oid
} ) ;
Parameters
Type
repo
Repository
Repository where to store the tag
tag_name
String
Name for the tag; this name is validated for consistency. It should also not conflict with an already existing tag name
target
Object
Object to which this tag points. This object must belong to the given repo.
tagger
Signature
Signature of the tagger for this tag, and of the tagging time
message
String
Full message for this tag
force
Number
Overwrite existing references
Returns
Oid
the OID of the
newly created tag. If the tag already exists, this parameter
will be the oid of the existing tag, and the function will
return a GIT_EEXISTS error code.
Tag. createLightweight Async
Tag . createLightweight ( repo , tag_name , target , force ) . then ( function ( oid ) {
// Use oid
} ) ;
Parameters
Type
repo
Repository
Repository where to store the lightweight tag
tag_name
String
Name for the tag; this name is validated for consistency. It should also not conflict with an already existing tag name
target
Object
Object to which this tag points. This object must belong to the given repo.
force
Number
Overwrite existing references
Returns
Oid
the OID of the provided
target object. If the tag already exists, this parameter
will be filled with the oid of the existing pointed object
and the function will return a GIT_EEXISTS error code.
Tag . delete ( repo , tag_name ) . then ( function ( result ) {
// Use result
} ) ;
Parameters
Type
repo
Repository
Repository where lives the tag
tag_name
String
Name of the tag to be deleted; this name is validated for consistency.
Returns
Number
0 on success, GIT_EINVALIDSPEC or an error code
Tag . list ( repo ) . then ( function ( array ) {
// Use array
} ) ;
Parameters
Type
repo
Repository
Repository where to find the tags
var result = Tag . listMatch ( tag_names , pattern , repo ) ;
Parameters
Type
tag_names
Strarray
Pointer to a git_strarray structure where the tag names will be stored
pattern
String
Standard fnmatch pattern
repo
Repository
Repository where to find the tags
Returns
Number
0 or an error code
Tag . lookup ( repo , id ) . then ( function ( tag ) {
// Use tag
} ) ;
Retrieves the tag pointed to by the oid
Parameters
Type
repo
Repository
The repo that the tag lives in
id
String, Oid , Tag
The tag to lookup
Tag . lookupPrefix ( repo , id , len ) . then ( function ( tag ) {
// Use tag
} ) ;
Parameters
Type
repo
Repository
the repo to use when locating the tag.
id
Oid
identity of the tag to locate.
len
Number
the length of the short identifier
tag . dup ( ) . then ( function ( tag ) {
// Use tag
} ) ;
Returns
Oid
object identity for the tag.
var string = tag . message ( ) ;
Returns
String
message of the tag or NULL when unspecified
Returns
String
name of the tag
var repository = tag . owner ( ) ;
Returns
Repository
Repository that contains this tag.
tag . peel ( ) . then ( function ( object ) {
// Use object
} ) ;
var signature = tag . tagger ( ) ;
Returns
Signature
reference to the tag's author or NULL when unspecified
var object = tag . target ( ) ;
var oid = tag . targetId ( ) ;
var result = tag . targetType ( ) ;
Returns
Number
type of the tagged object