Module Commit

Class "Commit". Extends Object

Functions

Commit.create (oid, repo, update_ref, author, committer, message_encoding, message, tree, parent) module function.
Commit.lookup (repo, id) Create a new Commit object.
Commit:author () object method.
Commit:committer () object method.
Commit:id () object method.
Commit:message () object method.
Commit:message_encoding () object method.
Commit:parent (n) object method.
Commit:parentcount () object method.
Commit:time () object method.
Commit:time_offset () object method.
Commit:tree () object method.
Object:free () Destroy this object (will be called by Garbage Collector).
Object:id () object method.
Object:owner () object method.
Object:type () object method.


Functions

Commit.create (oid, repo, update_ref, author, committer, message_encoding, message, tree, parent)
module function.

Parameters

  • oid: Must be of type OID.
  • repo: Must be of type Repository.
  • update_ref: Must be of type string.
  • author: Must be of type Signature.
  • committer: Must be of type Signature.
  • message_encoding: Must be of type string.
  • message: Must be of type string.
  • tree: Must be of type Tree.
  • parent: Must be of type Commit.

Return values:

  1. true if no error.
  2. Error string.
Commit.lookup (repo, id)
Create a new Commit object.

Calls git_commit_lookup:

Parameters

  • repo: the repo to use when locating the commit.. Must be of type Repository.
  • id: identity of the commit to locate. If the object is an annotated tag it will be peeled back to the commit.. Must be of type OID.

Return values:

  1. Commit or nil on error.
  2. Error string.
Commit:author ()
object method.

Calls git_commit_author:

Return value:

Signature.
Commit:committer ()
object method.

Calls git_commit_committer:

Return value:

Signature.
Commit:id ()
object method.

Calls git_commit_id:

Return value:

OID.
Commit:message ()
object method.

Calls git_commit_message:

Return value:

string.
Commit:message_encoding ()
object method.

Calls git_commit_message_encoding:

The encoding may be NULL if the `encoding` header in the commit is missing; in that case UTF-8 is assumed.

Return value:

string.
Commit:parent (n)
object method.

Calls git_commit_parent:

Parameters

  • n: the position of the parent (from 0 to `parentcount`). Must be of type integer.

Return values:

  1. Commit or nil on error.
  2. Error string.
Commit:parentcount ()
object method.

Calls git_commit_parentcount:

Return value:

integer.
Commit:time ()
object method.

Calls git_commit_time:

Return value:

integer.
Commit:time_offset ()
object method.

Calls git_commit_time_offset:

Return value:

integer.
Commit:tree ()
object method.

Calls git_commit_tree:

Return values:

  1. Tree or nil on error.
  2. Error string.
Object:free ()
Destroy this object (will be called by Garbage Collector).

Calls git_object_free:

This method instructs the library to close an existing object; note that git_objects are owned and cached by the repository so the object may or may not be freed after this library call, depending on how agressive is the caching mechanism used by the repository.

IMPORTANT: It *is* necessary to call this method when you stop using an object. Failure to do so will cause a memory leak.

Object:id ()
object method.

Calls git_object_id:

Return value:

OID.
Object:owner ()
object method.

Calls git_object_owner:

Freeing or calling `git_repository_close` on the returned pointer will invalidate the actual object.

Any other operation may be run on the repository without affecting the object.

Return value:

Repository.
Object:type ()
object method.

Calls git_object_type:

Return value:

string.

Valid XHTML 1.0!