From 56511a51afc66bc7efebee657bf040624defde65 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 25 May 2026 00:19:47 -0500 Subject: feat: add the unified ticket save model with save-issue and save-all Editing a ticket meant remembering which per-field command to run: pearl-sync-current-issue for the description, pearl-sync-current-issue-title for the heading, pearl-edit-current-comment for a comment. Three fields, three commands, and no single way to edit several fields (or several tickets) and push them at once. I added a layered save engine and two commands over it. pearl--run-field-save does the fetch, the three-way conflict gate, and the push for one field, emitting a single structured outcome instead of messaging from its callback. The three interactive sync commands are now thin wrappers over the per-field savers, so they keep working and gain the outcome. pearl-save-issue diffs the ticket at point and pushes only what changed. pearl-save-all scans the whole file, confirms once naming the field counts, and saves every diff in a sequential pass that continues past a per-ticket conflict. A queue runner keeps at most one conflict-resolution buffer live at a time. I also fixed a correctness bug: a description push now advances both LINEAR-DESC-SHA256 (the markdown the remote gate hashes against) and LINEAR-DESC-ORG-SHA256 (the rendered-Org baseline the local scan uses). Advancing only the markdown hash left the Org hash stale, so the next local scan would flag a just-saved ticket as dirty again. The conflict resolver gained an optional outcome callback so the engine can report cancel, use-local, use-remote, and the deferred smerge commit or abort as distinct outcomes. I removed the now-dead pearl--commit-sync-decision. The keybinding scheme and the transient menu retarget are a separate follow-up. Spec: docs/ticket-save-model-spec.org. --- tests/test-pearl-conflict.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test-pearl-conflict.el') diff --git a/tests/test-pearl-conflict.el b/tests/test-pearl-conflict.el index 03d8f31..138e622 100644 --- a/tests/test-pearl-conflict.el +++ b/tests/test-pearl-conflict.el @@ -212,7 +212,7 @@ (cl-letf (((symbol-function 'pearl--read-conflict-resolution) (lambda (_) 'rewrite)) ;; Emulate the user resolving the buffer and committing. ((symbol-function 'pearl--resolve-conflict-in-smerge) - (lambda (_label _local _remote on-finish) + (lambda (_label _local _remote on-finish &optional _on-abort) (funcall on-finish "merged text")))) (pearl--resolve-conflict "ENG-1 description" "local text" "remote text" marker "LINEAR-DESC-SHA256" -- cgit v1.2.3