pub struct FragMap {
pub commits: Vec<String>,
pub clusters: Vec<SpanCluster>,
pub matrix: Vec<Vec<TouchKind>>,
}Expand description
The complete fragmap: commits, span clusters, and the matrix showing which commits touch which clusters.
The matrix is commits × clusters, where matrix[commit_idx][cluster_idx] indicates how that commit touches that cluster.
Fields§
§commits: Vec<String>The commits in order (oldest to newest).
clusters: Vec<SpanCluster>The span clusters (code regions touched by commits).
matrix: Vec<Vec<TouchKind>>Matrix[commit_idx][cluster_idx] = TouchKind
Implementations§
Source§impl FragMap
impl FragMap
Sourcepub fn squash_target(&self, commit_idx: usize) -> Option<usize>
pub fn squash_target(&self, commit_idx: usize) -> Option<usize>
Find the single commit this commit can be squashed into, if any.
Returns Some(target_idx) when every cluster the commit touches is
squashable (no conflicting commits in between) and all clusters
point to the same single earlier commit. Returns None otherwise.
Sourcepub fn is_fully_squashable(&self, commit_idx: usize) -> bool
pub fn is_fully_squashable(&self, commit_idx: usize) -> bool
Check if a commit is fully squashable into a single other commit.
Check whether two commits both touch at least one common cluster.
Sourcepub fn pairwise_squash_relation(&self, a: usize, b: usize) -> SquashRelation
pub fn pairwise_squash_relation(&self, a: usize, b: usize) -> SquashRelation
Determine the overall squash relationship between two commits.
Examines every cluster both commits touch:
NoRelationif they share no clusters at all.Squashableif every shared cluster is squashable (no interfering commits in between).Conflictingif any shared cluster has interfering commits.
Sourcepub fn cluster_relation(
&self,
earlier_commit_idx: usize,
later_commit_idx: usize,
cluster_idx: usize,
) -> SquashRelation
pub fn cluster_relation( &self, earlier_commit_idx: usize, later_commit_idx: usize, cluster_idx: usize, ) -> SquashRelation
Determine the relationship between two commits for a specific cluster.
Returns NoRelation if one or both commits don’t touch the cluster,
Squashable if both touch it with no collisions in between, or
Conflicting if both touch it with other commits in between.
Sourcepub fn connector_squashable(
&self,
commit_idx: usize,
cluster_idx: usize,
scope: SquashableScope,
) -> Option<bool>
pub fn connector_squashable( &self, commit_idx: usize, cluster_idx: usize, scope: SquashableScope, ) -> Option<bool>
Determine whether a connector between below_idx and its earliest
earlier neighbour in cluster_idx should be rendered as squashable.
Returns None if there is no connector (no touch above or no below).
Returns Some(true) for squashable, Some(false) for conflicting.
scope controls the rule used:
Cluster: per-cluster pair only (fine-grained).Commit: the entire lower commit must be fully squashable into the same single upper commit (strict, matching the original fragmap tool).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FragMap
impl RefUnwindSafe for FragMap
impl Send for FragMap
impl Sync for FragMap
impl Unpin for FragMap
impl UnsafeUnpin for FragMap
impl UnwindSafe for FragMap
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§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