Struct git_cliff_core::commit::Commit
source · [−]pub struct Commit<'a> {
pub id: String,
pub message: String,
pub conv: Option<ConventionalCommit<'a>>,
pub group: Option<String>,
pub default_scope: Option<String>,
pub scope: Option<String>,
pub links: Vec<Link>,
pub author: Signature,
pub committer: Signature,
}
Expand description
Common commit object that is parsed from a repository.
Fields
id: String
Commit ID.
message: String
Commit message including title, description and summary.
conv: Option<ConventionalCommit<'a>>
Conventional commit.
group: Option<String>
Commit group based on a commit parser or its conventional type.
default_scope: Option<String>
Default commit scope based on (inherited from) conventional type or a commit parser.
scope: Option<String>
Commit scope for overriding the default one.
links: Vec<Link>
A list of links found in the commit
Commit author.
committer: Signature
Committer.
Implementations
sourceimpl Commit<'_>
impl Commit<'_>
sourcepub fn process(&self, config: &GitConfig) -> Result<Self>
pub fn process(&self, config: &GitConfig) -> Result<Self>
Processes the commit.
- converts commit to a conventional commit
- sets the group for the commit
- extacts links and generates URLs
sourcepub fn into_conventional(self) -> Result<Self>
pub fn into_conventional(self) -> Result<Self>
Returns the commit with its conventional type set.
sourcepub fn preprocess(self, preprocessors: &[CommitPreprocessor]) -> Result<Self>
pub fn preprocess(self, preprocessors: &[CommitPreprocessor]) -> Result<Self>
Preprocesses the commit using CommitPreprocessor
s.
Modifies the commit message
using regex or custom OS command.
sourcepub fn parse(self, parsers: &[CommitParser], filter: bool) -> Result<Self>
pub fn parse(self, parsers: &[CommitParser], filter: bool) -> Result<Self>
Parses the commit using CommitParser
s.
sourcepub fn parse_links(self, parsers: &[LinkParser]) -> Result<Self>
pub fn parse_links(self, parsers: &[LinkParser]) -> Result<Self>
Parses the commit using LinkParser
s.
Sets the links
of the commit.
Trait Implementations
sourceimpl<'de, 'a> Deserialize<'de> for Commit<'a>
impl<'de, 'a> Deserialize<'de> for Commit<'a>
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<'a> StructuralPartialEq for Commit<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for Commit<'a>
impl<'a> Send for Commit<'a>
impl<'a> Sync for Commit<'a>
impl<'a> Unpin for Commit<'a>
impl<'a> UnwindSafe for Commit<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more