class documentation
class Commit(ShaFile):
Constructors: Commit.from_path(path, sha, object_format), Commit()
A git commit object.
| Class Method | from |
Read a commit from a file on disk. |
| Method | __init__ |
Initialize an empty Commit. |
| Method | check |
Check this object for internal consistency. |
| Method | extract |
Extract the payload, signature, and signature type from this commit. |
| Method | raw |
Return raw string serialization without the GPG/SSH signature. |
| Class Variable | __slots__ |
Undocumented |
| Class Variable | author |
Undocumented |
| Class Variable | author |
Undocumented |
| Class Variable | author |
Undocumented |
| Class Variable | commit |
Undocumented |
| Class Variable | commit |
Undocumented |
| Class Variable | committer |
Undocumented |
| Class Variable | encoding |
Undocumented |
| Class Variable | gpgsig |
Undocumented |
| Class Variable | mergetag |
Undocumented |
| Class Variable | message |
Undocumented |
| Class Variable | parents |
Undocumented |
| Class Variable | tree |
Undocumented |
| Class Variable | type |
Undocumented |
| Class Variable | type |
Undocumented |
| Method | _deserialize |
Undocumented |
| Method | _get |
Return a list of parents of this commit. |
| Method | _serialize |
Undocumented |
| Method | _set |
Set a list of parents of this commit. |
| Instance Variable | _author |
Undocumented |
| Instance Variable | _author |
Undocumented |
| Instance Variable | _author |
Undocumented |
| Instance Variable | _commit |
Undocumented |
| Instance Variable | _commit |
Undocumented |
| Instance Variable | _committer |
Undocumented |
| Instance Variable | _encoding |
Undocumented |
| Instance Variable | _extra |
Undocumented |
| Instance Variable | _gpgsig |
Undocumented |
| Instance Variable | _mergetag |
Undocumented |
| Instance Variable | _message |
Undocumented |
| Instance Variable | _needs |
Undocumented |
| Instance Variable | _parents |
Undocumented |
| Instance Variable | _tree |
Undocumented |
Inherited from ShaFile:
| Class Method | from |
Get the contents of a SHA file on disk. |
| Class Method | from |
Create a ShaFile from a string. |
| Static Method | from |
Creates an object of the indicated type from the raw chunks given. |
| Static Method | from |
Creates an object of the indicated type from the raw string given. |
| Method | __bytes__ |
Return raw string serialization of this object. |
| Method | __eq__ |
Return True if the SHAs of the two objects match. |
| Method | __hash__ |
Return unique hash for this object. |
| Method | __le__ |
Check whether SHA of this object is less than or equal to the other. |
| Method | __lt__ |
Return whether SHA of this object is less than the other. |
| Method | __ne__ |
Check whether this object does not match the other. |
| Method | __repr__ |
Return string representation of this object. |
| Method | as |
Return string representing the object in the experimental format. |
| Method | as |
Return chunks representing the object in the experimental format. |
| Method | as |
Return a string representing this object, fit for display. |
| Method | as |
Return chunks with serialization of the object. |
| Method | as |
Return raw string with serialization of the object. |
| Method | copy |
Create a new copy of this SHA1 object from its raw string. |
| Method | get |
Get the hex SHA of this object using the specified hash algorithm. |
| Method | raw |
Returns the length of the raw string of this object. |
| Method | set |
Set the contents of this object from a list of chunks. |
| Method | set |
Set the contents of this object from a serialized string. |
| Method | sha |
The SHA object that is the name of this object. |
| Instance Variable | object |
Undocumented |
| Property | id |
The hex SHA1 of this object. |
| Class Method | _is |
Undocumented |
| Class Method | _parse |
Undocumented |
| Static Method | _parse |
Parse a legacy object, creating it but not reading the file. |
| Static Method | _parse |
Parse a new style object, creating it but not reading the file. |
| Method | _check |
Check that the object has a given member variable. |
| Method | _header |
Undocumented |
| Method | _parse |
Parse a legacy object, setting the raw string. |
| Method | _parse |
Parse a new style object, setting self._text. |
| Instance Variable | _chunked |
Undocumented |
| Instance Variable | _sha |
Undocumented |
def from_path(cls, path:
str | bytes, sha: ObjectID | None = None, *, object_format: ObjectFormat | None = None) -> Commit:
¶
overrides
dulwich.objects.ShaFile.from_pathRead a commit from a file on disk.
| Parameters | |
path:str | bytes | Path to the commit file |
sha:ObjectID | None | Optional known SHA for the object |
objectObjectFormat | None | Optional object format to use |
| Returns | |
Commit | A Commit object |
| Raises | |
NotCommitError | If the file is not a commit |
overrides
dulwich.objects.ShaFile.checkCheck this object for internal consistency.
| Raises | |
ObjectFormatException | if the object is malformed in some way |
Extract the payload, signature, and signature type from this commit.
| Returns | |
tuple of (payload, signature, signature_type) where |
|
| Raises | |
ObjectFormatException | If signature has unknown format |
Return raw string serialization without the GPG/SSH signature.
self.gpgsig is a signature for the returned raw byte string serialization.