Skip to main content
Version: Next

The merge matrix in practice

sync decides every block of the base by crossing two questions: what did upstream do to it, and did you edit it?

Upstream didYou edited itOutcomeIn the report
nothingnonothing to do(not counted)
nothing, or moved it verbatimyesREAPPLY — your text is spliced at its new positionN edit(s) reapplied
changed itnoUPDATE — upstream's text standsN block(s) updated from upstream
changed ityesCONFLICT — your text stays in the file, all three recordedN conflict(s) + a [CONFLICT …] block
deleted itnoit is simply goneN removed
deleted ityesORPHAN — a conflict flavourN conflict(s) + an [ORPHAN …] block
added a new block—upstream's block is takenN inserted

Two consequences worth internalising:

The structure is always upstream's. The merged document is U's tree with your texts spliced into it. Nothing is assembled from fragments, so upstream's section order, new sections and deletions all arrive intact — and the render is re-parsed and compared before it is written, so a splice that would corrupt block structure is refused rather than shipped.

A conflict is narrow. It is one block, not one file. Every other block in the same document merges normally in that same run; the conflict just parks one decision. What it does block is the next sync of that document, so you can never merge against a base you never accepted:

$ cedit sync --from vendor; echo "rc=$?"
skills/deploy/SKILL.md: 1 unresolved conflict(s) — resolve them before syncing again
rc=2