## GgitCommit GgitCommit |

## Synopsis

                        GgitCommit;
    struct              GgitCommitClass;
                        GgitCommitParents;
    const gchar *       ggit_commit_get_message_encoding    (GgitCommit *commit);
    const gchar *       ggit_commit_get_message             (GgitCommit *commit);
    const gchar *       ggit_commit_get_subject             (GgitCommit *commit);
    GgitSignature *     ggit_commit_get_committer           (GgitCommit *commit);
    GgitSignature *     ggit_commit_get_author              (GgitCommit *commit);
    GgitCommitParents * ggit_commit_get_parents             (GgitCommit *commit);
    GgitCommitParents * ggit_commit_parents_ref             (GgitCommitParents *parents);
    void                ggit_commit_parents_unref           (GgitCommitParents *parents);
    guint               ggit_commit_parents_size            (GgitCommitParents *parents);
    GgitCommit *        ggit_commit_parents_get             (GgitCommitParents *parents,
                                                             guint idx);
    GgitOId *           ggit_commit_parents_get_id          (GgitCommitParents *parents,
                                                             guint idx);
    GgitTree *          ggit_commit_get_tree                (GgitCommit *commit);
    GgitOId *           ggit_commit_get_tree_id             (GgitCommit *commit);
    GgitCommit *        ggit_commit_get_nth_ancestor        (GgitCommit *commit,
                                                             guint n,
                                                             GError **error);

## Object Hierarchy

      GObject
       +----GgitObjectFactoryBase
             +----GgitNative
                   +----GgitObject
                         +----GgitCommit

      GBoxed
       +----GgitCommitParents

## Description

## Details

### GgitCommit

    typedef struct _GgitCommit GgitCommit;

Represents a commit object.

### struct GgitCommitClass

    struct GgitCommitClass {
    };

The class structure for GgitCommitClass.

### GgitCommitParents

    typedef struct _GgitCommitParents GgitCommitParents;

Represents the parents of a commit object.

### ggit_commit_get_message_encoding ()

    const gchar *       ggit_commit_get_message_encoding    (GgitCommit *commit);

Get the encoding for the message of a commit, as a string representing a standard encoding name.

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

`commit` : | a GgitCommit.
Returns : | the encoding of the commit message or `NULL`.

### ggit_commit_get_message ()

    const gchar *       ggit_commit_get_message             (GgitCommit *commit);

Gets the full message of `commit`. The resulting message is always encoded in UTF-8.

`commit` : | a GgitCommit.
Returns : | the message of the commit.

### ggit_commit_get_subject ()

    const gchar *       ggit_commit_get_subject             (GgitCommit *commit);

Gets the subject of `commit`. The subject of a commit is the first line of the commit message (as per convention). The resulting subject is always encoded in UTF-8.

`commit` : | a GgitCommit.
Returns : | the subject of the commit.

### ggit_commit_get_committer ()

    GgitSignature *     ggit_commit_get_committer           (GgitCommit *commit);

Gets the committer of `commit`. The returned value must be free'd with `g_object_unref()`.

`commit` : | a GgitCommit.
Returns : | the committer of the commit. [transfer full]

### ggit_commit_get_author ()

    GgitSignature *     ggit_commit_get_author              (GgitCommit *commit);

Gets the author of `commit`. The returned value must be free'd with `g_object_unref()`.

`commit` : | a GgitCommit.
Returns : | the author of the commit. [transfer full]

### ggit_commit_get_parents ()

    GgitCommitParents * ggit_commit_get_parents             (GgitCommit *commit);

Gets the parents collection for `commit`.

`commit` : | a GgitCommit.
Returns : | the parents collection of the commit. [transfer full]

### ggit_commit_parents_ref ()

    GgitCommitParents * ggit_commit_parents_ref             (GgitCommitParents *parents);

Atomically increments the reference count of `parents` by one. This function is MT-safe and may be called from any thread.

`parents` : | a GgitCommitParents.
Returns : | a GgitCommitParents.

### ggit_commit_parents_unref ()

    void                ggit_commit_parents_unref           (GgitCommitParents *parents);

Atomically decrements the reference count of `parents` by one. If the reference count drops to 0, `parents` is freed.

`parents` : | a GgitCommitParents.

### ggit_commit_parents_size ()

    guint               ggit_commit_parents_size            (GgitCommitParents *parents);

Get the number of parents in the parents collection.

`parents` : | a GgitCommitParents.
Returns : | the number of parents.

### ggit_commit_parents_get ()

    GgitCommit *        ggit_commit_parents_get             (GgitCommitParents *parents,
                                                             guint idx);

Get the GgitCommit of a parent.

`parents` : | a GgitCommitParents.
`idx` : | the parent index.
Returns : | a GgitCommit. [transfer full]

### ggit_commit_parents_get_id ()

    GgitOId *           ggit_commit_parents_get_id          (GgitCommitParents *parents,
                                                             guint idx);

Get the GgitOId of a parent.

`parents` : | a GgitCommitParents.
`idx` : | the parent index.
Returns : | a GgitOId. [transfer full]

### ggit_commit_get_tree ()

    GgitTree *          ggit_commit_get_tree                (GgitCommit *commit);

Get the tree object for `commit`.

`commit` : | a GgitCommit.
Returns : | a GgitTree. [transfer full]

### ggit_commit_get_tree_id ()

    GgitOId *           ggit_commit_get_tree_id             (GgitCommit *commit);

Get the GgitOId of the tree of `commit`. Note that this is more efficient than getting the tree object with `ggit_commit_get_tree()` because no additional files need to be read from disk.

`commit` : | a GgitCommit.
Returns : | (transfer full) a GgitOId.

### ggit_commit_get_nth_ancestor ()

    GgitCommit *        ggit_commit_get_nth_ancestor        (GgitCommit *commit,
                                                             guint n,
                                                             GError **error);

Gets the commit object that is the n-th generation ancestor of the named commit object, following only the first parents. Passing `0` to the `n` parameter returns another instance of `commit`.

`commit` : | a GgitCommit.
`n` : | the requested ancestor.
`error` : | a GError for error reporting, or `NULL`.
Returns : | the `n` ancestor commit. [transfer full]