Tag

Within git there are 2 types of tags, lightweight and annotated. Lightweight tags are REFERENCES within the tag namespace. Annotated tags are objects stored in the ODB. Annotated tags have a TARGET and a TAGGER, which makes them different from commits. TAG-P can be used to determine if a tag or reference is a “tag”.

CLOS class tag
Superclass:

[‘T’]

Metaclass:

standard-class

Tags are used to identify interesting points in the repositories history.

Details

Method (full-name (object TAG))

Returns the name of OBJECT, as a string.

What exactly the name is depends on the type of the object.

See also: full-name

Method (short-name (object TAG))

Returns the short name of OBJECT, as a string.

What exactly the name is depends on the type of the object.

See also: short-name

Generic (tagger object)
(tagger (tag REFERENCE))
(tagger (tag TAG))

Returns the signature of the tagger of OBJECT.

The return value is a signature (a property list with keys :NAME, :EMAIL and :TIME. If the tag is not annotated then nil will be returned.

Method (message (object TAG))

Return the message associated with OBJECT.

For example for commits this will return the commit message and for tags the message associated with the tag.

See also: message

Target

Method (target (object TAG))

Returns the target of a tag.

See also: target

Method (resolve (object TAG) &optional stop-at)

Resolve the tag target until the target object is not a tag anymore. Basically calls TARGET on tag and result until there is a COMMIT returned.

Using values returns the finally found object and a list of the traversed objects.

See also: resolve

Creating

Method (make-object (class (eq TAG)) (id/name T) (repository T) &key url type force target signature message log-message &allow-other-keys)

Create a tag to TARGET. The type of tag depends on TYPE. If TYPE is :ANNOTATED the value of TARGET should be an OID and a direct tag is created. If TYPE is :LIGHTWEIGHT, a reference is created and TARGET should be a OID. SIGNATURE should be a signature plist.

If FORCE is t the tag will be created, even if a tag with the same name already exists. If FORCE is nil, it will return an error if that is the case.

See also: make-object

Accessing

Method (get-object (class (eq TAG)) (id/name T) (repository T))

Return an object of type CLASS from the object database. The lookup will use either an oid or a name to find the object.

See also: get-object

Method (list-objects (class (eq TAG)) (repository T) &key test test-not)

Returns a list of tag for the repository. If the tag is an annotated tag then a TAG object will be returned, otherwise it will be a ref with the in the tag namespace.

GIT> (list-objects 'tag (open-repository #p"/home/russell/projects/ecl/"))

(#<TAG refs/tags/ECL.8.12.0 {1006621153}>
 #<REFERENCE refs/tags/ECL.9.8.3 {1006B277C3}>
 #<REFERENCE refs/tags/ECL.9.8.4 {1006B279C3}>
 #<REFERENCE refs/tags/ECL.9.8.2 {1006B27BC3}>
 #<REFERENCE refs/tags/ECLS.0.4 {1006B27DC3}>
 #<REFERENCE refs/tags/ECL.13.5.1 {1006B27FD3}>
 ...)

See also: list-objects