Skip to content
zit Tech-note 7e7d24b5d2
Login

Tech-note 7e7d24b5d2

A forge that shows a landing has to show its conflicts too, and the author should be able to settle them in the browser. Until now zit could only say which paths conflicted. The regions were visible only to zit merge in a working checkout, written into the files as conflict markers. And nothing could record a merge from answers given somewhere else.

0.3.39 adds both halves to zit merge-tree. With -F json it prints the merge as one document: each conflicting file, what kind of conflict it is, each side's blob and mode, and for text the regions of the merge, each marked as unchanged, changed by one side, changed the same way by both, or in conflict, with its line ranges in the base and on each side. The regions come out of the same loop that merges, so a page drawn from them shows the merge zit makes, not a second engine's guess at it.

With --commit it records the merge with the author's answers: one resolved file per conflicting path, or --delete for a path settled by removing it. It refuses, writing nothing, if the answers miss a path, still hold a marker, or were made against a branch that has since moved. The check-in is the one zit merge and zit commit would make by hand with the same answers.

That is what a conflict view like quarry's needs: the branch on the left, the target on the right, the result in the middle, and a button that commits it.