feat(resolve): add resolve command and log integration (#125)

Add first-class conflict resolution support to jj.nvim.

   - add `jj.cmd.resolve` to run `jj resolve` in a floating terminal or via an
     external tool
   - add `:J resolve` with support for `-r/--revision`, `--tool`,
     `--external/--ext`, and positional filesets
   - integrate resolve into the log buffer with the `gr` mapping and optional
     `resolve_strategies` picker
   - add `utils.is_change_conflicted()` and avoid opening resolve when the
     selected revision has no conflicts
   - document resolve usage, config, and keymaps in the README
   - add tests for resolve arg parsing and conflict detection helpers
This commit is contained in:
Nicolas GB
2026-06-16 19:06:33 +02:00
committed by GitHub
parent 9f2a76d079
commit 7fc91fe6d2
7 changed files with 543 additions and 31 deletions
+18
View File
@@ -644,6 +644,24 @@ function M.is_change_empty(revset)
return vim.trim(output) == "true"
end
--- Check if a given revset has conflicts
--- @param revset string The revset to check
--- @return boolean True if the revset has conflicts, false otherwise
function M.is_change_conflicted(revset)
local output, success = runner.execute_command(
string.format("jj log --no-graph -r %s -T 'conflict' --quiet", vim.fn.shellescape(revset)),
"Error checking if revset has conflicts",
nil,
true
)
if not success or not output then
return false
end
return vim.trim(output) == "true"
end
--- Build describe text for a given revision
--- @param revset? string The revision to describe (default: @)
--- @return string[]|nil