Struct git2::Commit[][src]

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

A structure to represent a git commit

Methods

impl<'repo> Commit<'repo>
[src]

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.

Important traits for Parents<'commit, 'repo>

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 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

impl<'repo> Debug for Commit<'repo>
[src]

Formats the value using the given formatter. Read more

impl<'repo> Clone for Commit<'repo>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'repo> Drop for Commit<'repo>
[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<'repo> !Send for Commit<'repo>

impl<'repo> !Sync for Commit<'repo>