Ggit.Commit¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Ggit.Commit(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Represents a commit object.
- amend(update_ref, author, committer, message_encoding, message, tree)¶
- Parameters:
author (
Ggit.Signature
) – author signature.committer (
Ggit.Signature
) – committer signature (and time of commit).message (
str
) – commit message.tree (
Ggit.Tree
) – the tree of objects to commit.
- Raises:
- Returns:
the
Ggit.OId
of the created commit object, orNone
in case of an error.- Return type:
Amend an existing commit. If update_ref is not
None
, the given reference will be updated to point to the newly created commit. Use “HEAD” to update the HEAD of the current branch and make it point to this commit.If message_encoding is set to
None
, “UTF-8” encoding is assumed for the provided message. Note that message will not be cleaned up automatically. You can useGgit.message_prettify
to do this yourself if needed.
- get_author()¶
- Returns:
the author of the commit.
- Return type:
Gets the author of self. The returned value must be free’d with
GObject.Object.unref
().
- get_committer()¶
- Returns:
the committer of the commit.
- Return type:
Gets the committer of self. The returned value must be free’d with
GObject.Object.unref
().
- get_message()¶
-
Gets the full message of self. The resulting message is always encoded in UTF-8.
- get_message_encoding()¶
-
Get the encoding for the message of a commit, as a string representing a standard encoding name.
The encoding may be
None
if the ‘encoding’ header in the commit is missing; in that case UTF-8 is assumed.
- get_nth_ancestor(n)¶
- Parameters:
n (
int
) – the requested ancestor.- Raises:
- Returns:
the n ancestor commit.
- Return type:
Ggit.Commit
orNone
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 self.
- get_parents()¶
- Returns:
the parents collection of the commit.
- Return type:
Gets the parents collection for self.
- get_subject()¶
-
Gets the subject of self. 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.