Skip to main content

Module diff3

Module diff3 

Source
Expand description

Three-way text merge (diff3 algorithm).

This is the baseline merge strategy used by git. We implement it from scratch using the similar crate for LCS-based diffing, following the classic diff3 algorithm that partitions the file into stable and unstable regions.

References:

  • Khanna, Kuber, Pierce (2007), “A Formal Investigation of Diff3”
  • GNU diff3 implementation

Functions§

diff3_hunks
Run a three-way merge on line-level text.
diff3_merge
Perform a full three-way merge, returning a single MergeResult.
extract_conflicts
Extract all conflict regions from a three-way merge.