Skip to main content

diff

Function diff 

Source
pub fn diff(a: &Tree, b: &Tree) -> Vec<DeltaOp>
Expand description

Compute a delta that transforms a into b. apply(a, diff(a, b)) equals b (modulo position resolution; see the property tests).

The diff is structurally faithful but not optimized: it never emits DeltaOp::Replace for whole-subtree collapse. The 40%-edit- distance threshold lives at the daemon level (M4) where ref churn is observable across many snapshots.