pub trait GitHistory {
type Error: StdError + Send + Sync + 'static;
// Required methods
fn commit_messages(
&self,
repository: &Path,
from: Option<&str>,
to: &str,
scope: UnitScope<'_>,
) -> Result<Vec<String>, Self::Error>;
fn equivalent(
&self,
repository: &Path,
base: &str,
first: &str,
second: &str,
) -> Result<bool, Self::Error>;
fn has_changes(
&self,
repository: &Path,
from: Option<&str>,
to: &str,
scope: UnitScope<'_>,
) -> Result<bool, Self::Error>;
fn is_ancestor(
&self,
repository: &Path,
ancestor: &str,
descendant: &str,
) -> Result<bool, Self::Error>;
fn resolve(
&self,
repository: &Path,
rev: &str,
) -> Result<String, Self::Error>;
fn tags(
&self,
repository: &Path,
prefix: &str,
) -> Result<Vec<String>, Self::Error>;
}Expand description
Read access to repository history.
Required Associated Types§
Required Methods§
Sourcefn commit_messages(
&self,
repository: &Path,
from: Option<&str>,
to: &str,
scope: UnitScope<'_>,
) -> Result<Vec<String>, Self::Error>
fn commit_messages( &self, repository: &Path, from: Option<&str>, to: &str, scope: UnitScope<'_>, ) -> Result<Vec<String>, Self::Error>
Messages of the commits after from up to to that change scope,
oldest first. Without from the walk reaches the root commit. Merge
commits are left out.
Sourcefn equivalent(
&self,
repository: &Path,
base: &str,
first: &str,
second: &str,
) -> Result<bool, Self::Error>
fn equivalent( &self, repository: &Path, base: &str, first: &str, second: &str, ) -> Result<bool, Self::Error>
Whether the first-parent chains from base to first and from base
to second have the same length and the same trees and messages.
A chain that does not reach base is equivalent to nothing.
Sourcefn has_changes(
&self,
repository: &Path,
from: Option<&str>,
to: &str,
scope: UnitScope<'_>,
) -> Result<bool, Self::Error>
fn has_changes( &self, repository: &Path, from: Option<&str>, to: &str, scope: UnitScope<'_>, ) -> Result<bool, Self::Error>
Whether scope differs between the commits from and to. Without
from the comparison starts from the empty tree.
Sourcefn is_ancestor(
&self,
repository: &Path,
ancestor: &str,
descendant: &str,
) -> Result<bool, Self::Error>
fn is_ancestor( &self, repository: &Path, ancestor: &str, descendant: &str, ) -> Result<bool, Self::Error>
Whether ancestor is descendant or reachable from it.
Sourcefn resolve(&self, repository: &Path, rev: &str) -> Result<String, Self::Error>
fn resolve(&self, repository: &Path, rev: &str) -> Result<String, Self::Error>
The commit a revision expression such as origin/main names.
List the tag names that start with prefix.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".