Crate gix_diff

Source
Expand description

Algorithms for diffing various git object types and for generating patches, highly optimized for performance.

§Feature Flags

  • blob (enabled by default) — Enable diffing of blobs using imara-diff.
  • index (enabled by default) — Enable diffing of two indices, which also allows for a generic rewrite tracking implementation.
  • serde — Data structures implement serde::Serialize and serde::Deserialize.
  • wasm — Make it possible to compile to the wasm32-unknown-unknown target.

Re-exports§

Modules§

Structs§

Functions§

  • indexindex
    Produce an entry-by-entry diff between lhs and rhs, sending changes to cb(change) -> Action for consumption, which would turn lhs into rhs if applied. Use pathspec to reduce the set of entries to look at, and pathspec_attributes may be used by pathspecs that perform attribute lookups.
  • Calculate the changes that would need to be applied to lhs to get rhs using objects to obtain objects as needed for traversal. state can be used between multiple calls to re-use memory.
  • Call for_each repeatedly with all changes that are needed to convert lhs to rhs. Provide a resource_cache to speed up obtaining blobs for similarity checks. tree_diff_state can be used to re-use tree-diff memory between calls. objects are used to lookup trees while performing the diff. Use options to further configure how the rename tracking is performed.