Struct git_cliff_core::commit::Commit
source · pub struct Commit<'a> {Show 14 fields
pub id: String,
pub message: String,
pub conv: Option<Commit<'a>>,
pub group: Option<String>,
pub default_scope: Option<String>,
pub scope: Option<String>,
pub links: Vec<Link>,
pub author: Signature,
pub committer: Signature,
pub merge_commit: bool,
pub github: RemoteContributor,
pub gitlab: RemoteContributor,
pub gitea: RemoteContributor,
pub bitbucket: RemoteContributor,
}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<Commit<'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.
merge_commit: boolWhether if the commit has two or more parents.
github: RemoteContributorgithub only.GitHub metadata of the commit.
gitlab: RemoteContributorgitlab only.GitLab metadata of the commit.
gitea: RemoteContributorgitea only.Gitea metadata of the commit.
bitbucket: RemoteContributorbitbucket only.Bitbucket metadata of the commit.
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: &[TextProcessor]) -> Result<Self>
pub fn preprocess(self, preprocessors: &[TextProcessor]) -> Result<Self>
Preprocesses the commit using TextProcessors.
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>,
source§impl<'a> PartialEq for Commit<'a>
impl<'a> PartialEq for Commit<'a>
impl<'a> StructuralPartialEq for Commit<'a>
Auto Trait Implementations§
impl<'a> Freeze for Commit<'a>
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more