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: StringCommit ID.
message: StringCommit 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: SignatureCommitter.
Implementations§
source§impl 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 CommitPreprocessors.
Modifies the commit message using regex or custom OS command.
sourcepub fn parse(
self,
parsers: &[CommitParser],
protect_breaking: bool,
filter: bool
) -> Result<Self>
pub fn parse(
self,
parsers: &[CommitParser],
protect_breaking: bool,
filter: bool
) -> Result<Self>
Parses the commit using CommitParsers.
sourcepub fn parse_links(self, parsers: &[LinkParser]) -> Result<Self>
pub fn parse_links(self, parsers: &[LinkParser]) -> Result<Self>
Parses the commit using LinkParsers.
Sets the links of the commit.
Trait Implementations§
source§impl<'de, 'a> Deserialize<'de> for Commit<'a>
impl<'de, 'a> Deserialize<'de> for Commit<'a>
source§fn 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