Struct git_repository::commit::describe::Platform
source · pub struct Platform<'repo> { /* private fields */ }
Expand description
A support type to allow configuring a git describe
operation
Implementations§
source§impl<'repo> Platform<'repo>
impl<'repo> Platform<'repo>
sourcepub fn names(self, select: SelectRef) -> Self
pub fn names(self, select: SelectRef) -> Self
Configure which names to select
from which describe can chose.
sourcepub fn traverse_first_parent(self, first_parent: bool) -> Self
pub fn traverse_first_parent(self, first_parent: bool) -> Self
If true, shorten the graph traversal time by just traversing the first parent of merge commits.
sourcepub fn max_candidates(self, candidates: usize) -> Self
pub fn max_candidates(self, candidates: usize) -> Self
Only consider the given amount of candidates, instead of the default of 10.
sourcepub fn id_as_fallback(self, use_fallback: bool) -> Self
pub fn id_as_fallback(self, use_fallback: bool) -> Self
If true, even if no candidate is available a format will always be produced.
sourcepub fn try_format(&self) -> Result<Option<Format<'static>>, Error>
pub fn try_format(&self) -> Result<Option<Format<'static>>, Error>
Try to find a name for the configured commit id using all prior configuration, returning Some(describe::Format)
if one was found.
Note that there will always be Some(format)
sourcepub fn try_resolve(&self) -> Result<Option<Resolution<'repo>>, Error>
pub fn try_resolve(&self) -> Result<Option<Resolution<'repo>>, Error>
Try to find a name for the configured commit id using all prior configuration, returning Some(Outcome)
if one was found.
The outcome provides additional information, but leaves the caller with the burden
Performance
It is greatly recommended to assure an object cache is set to save ~40% of time.