Skip to main content

Module merge

Module merge 

Source
Expand description

merge: reconciling two branches representing alternative continuations.

Merging conversation branches is fundamentally different from merging code: two forked branches are usually alternative continuations, not compatible edits to reconcile line-by-line. There is no automatic content merging of divergent natural-language turns here, and this module does not attempt to invent one. Instead, merge always creates an explicit merge commit referencing both parents for audit/lineage, and its materialized view is defined purely by parent order: RecordOnly puts branch_a’s head first (so it materializes as branch_a’s view, with branch_b linked as an alternative), and PreferOther puts branch_b’s head first instead. Both strategies are “no silent merging” — the untaken branch’s content never appears in the merged view; it’s only reachable by checking it out directly.

Functions§

merge
Merges branch_b into branch_a: creates a merge commit referencing both branches’ current heads (order determined by strategy), advances branch_a to point at it, and leaves branch_b untouched. Fails if either branch doesn’t exist, or if both heads are the same commit (nothing to merge).