Artifact 28c119c0cce287421bacf027b06638d1c364739ca6f5836da52e004f7ae5f406:
- File
src/cli.zig
-
2026-07-18 02:51:43
— part of check-in
[6bdb918f18]
on branch merge-verb
— Add the merge command: line-based three-way merge into the working tree
zit merge NAME computes a three-way merge of NAME (other) into the current checkout and records the merge parent; commit then mints the two-token P card. Built from the RFC oracle + the RESOLVED merge-base and conflict-model rules.
- merge3.zig: a pure diff3 line engine + per-path classifier (no I/O, injected allocator, error{OutOfMemory}). Both-modified binary, add-vs-add, and modify-vs-delete are whole-file conflicts by construction, never laundered through the line merger (artifact §8.2; B-merge-21). Seeded-deterministic fuzz. - repostate.mergeBaseOf: the merge base over full ancestry (§3.3, merge parents included) — greatest event.mtime, ties by least artifact hash (§2/§8.3, the RESOLVED merge-base rule). repostate.isAncestorOf: a pure, mtime-independent full-ancestry membership test — the authoritative up-to-date gate, so a same-mtime ancestor can never slip the refusal. - merge verb: resolve NAME (§8, one resolver), refuse (exit 1, nothing mutated) a dirty tree / a pending merge / an up-to-date or unrelated NAME; else classify each §8.2 merge-walk path and materialize transactionally via update.applyMerge (journal + checkout written before the first byte moves). Conflicts write fossil-style markers, name each path on stderr, exit 1, and still record the pending merge; zit undo unwinds it (B-merge-13). - commit: with a merge pending, scan the committed set for the conflict sentinel and refuse until resolved (no override); otherwise emit the primary-first two-token P card and clear the merge one-shot (§4.7.13; B-merge-8/9).
v1 non-goals held: no rename-aware, binary-content, cherrypick, or octopus merge. 1629 unit + 307 e2e green; dst 6x1000; fossil interop unaffected. (user: dmestas, size: 153404) [annotate] [blame] [check-ins using]
-
2026-07-18 02:53:32
— part of check-in
[c2c837c5e1]
on branch trunk
— Merge merge-verb: the zit merge command (three-way merge + two-token P card)
Completes the checkout-and-history CLI slice — merge is the sixth and final verb (after timeline, mv, undo/redo, extras, clean). Line-based three-way merge into the working tree with fossil-style conflict markers, a mtime-independent up-to-date/ancestry gate, and a commit that mints the primary-first two-token P card and refuses while any marker remains. 1629 unit + 307 e2e green; dst 6x1000. (user: dmestas, size: 153404) [annotate] [blame] [check-ins using]
-
2026-07-18 02:51:43
— part of check-in
[6bdb918f18]
on branch merge-verb
— Add the merge command: line-based three-way merge into the working tree