Struct git2::Commit[][src]

pub struct Commit<'repo> { /* fields omitted */ }
Expand description

A structure to represent a git commit

Implementations

Get the id (SHA1) of a repository commit

Get the id of the tree pointed to by this commit.

No attempts are made to fetch an object from the ODB.

Get the tree pointed to by a commit.

Get access to the underlying raw pointer.

Get the full message of a commit.

The returned message will be slightly prettified by removing any potential leading newlines.

None will be returned if the message is not valid utf-8

Get the full message of a commit as a byte slice.

The returned message will be slightly prettified by removing any potential leading newlines.

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

None will be returned if the encoding is not known

Get the full raw message of a commit.

None will be returned if the message is not valid utf-8

Get the full raw message of a commit.

Get the full raw text of the commit header.

None will be returned if the message is not valid utf-8

Get the full raw text of the commit header.

Get the short “summary” of the git commit message.

The returned message is the summary of the commit, comprising the first paragraph of the message with whitespace trimmed and squashed.

None may be returned if an error occurs or if the summary is not valid utf-8.

Get the short “summary” of the git commit message.

The returned message is the summary of the commit, comprising the first paragraph of the message with whitespace trimmed and squashed.

None may be returned if an error occurs

Get the commit time (i.e. committer time) of a commit.

The first element of the tuple is the time, in seconds, since the epoch. The second element is the offset, in minutes, of the time zone of the committer’s preferred time zone.

Creates a new iterator over the parents of this commit.

Creates a new iterator over the parents of this commit.

Get the author of this commit.

Get the committer of this commit.

Amend this existing commit with all non-None values

This creates a new commit that is exactly the same as the old commit, except that any non-None values will be updated. The new commit has the same parents as the old commit.

For information about update_ref, see Repository::commit.

Get the number of parents of this commit.

Use the parents iterator to return an iterator over all parents.

Get the specified parent of the commit.

Use the parents iterator to return an iterator over all parents.

Get the specified parent id of the commit.

This is different from parent, which will attempt to load the parent commit from the ODB.

Use the parent_ids iterator to return an iterator over all parents.

Casts this Commit to be usable as an Object

Consumes Commit to be returned as an Object

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.