Expand description
Pattern-based DSL resolution rules.
Implements a domain-specific language for common merge conflict resolution patterns, inspired by the program synthesis approach from Svyatkovskiy et al. (ICSE 2021) which found that ~28% of merge conflicts follow repetitive patterns and ~41% of 1-2 line changes can be resolved by a DSL.
Instead of learning patterns via synthesis, we encode the most common resolution patterns as declarative rules. Each rule has:
- A predicate that checks if the conflict matches the pattern
- A transform that produces the resolution
Common patterns from the literature:
- Both sides add imports/includes → keep both (union)
- Both sides modify the same value → prefer longer/more specific
- One side adds, other modifies → combine additions
- Adjacent-line edits (false conflict) → concatenate
- Whitespace/formatting only differences → pick either
- Both sides add to a list → interleave or concatenate
- Identical deletions → accept deletion
Structs§
- Pattern
Registry - Registry of all pattern rules.
Traits§
- Pattern
Rule - A pattern rule that can match and resolve a conflict.