Feat: Rewrite diff module to allow for external dependencies as jj.nvim's diff tool (#74)

- Refactor diff into modular architecture (native, diffview, codediff)
- Add the possibility for users to define their own diff backend
- Support external diff tools like diffview.nvim codediff.nvim
- Enable visual mode selection to diff two changes in log buffer
- Add summary tooltip integration with terminal
- Update documentation with new diff workflows
This commit is contained in:
Nicolas GB
2026-01-25 09:39:31 -08:00
committed by GitHub
parent 8ed2aa52aa
commit 335663c3ee
14 changed files with 590 additions and 162 deletions
+20 -1
View File
@@ -261,7 +261,7 @@ end
--- @return boolean True if the change is immutable, false otherwise
function M.is_change_immutable(revset)
local output, success = runner.execute_command(
string.format("jj log --no-graph -r '%s' -T 'immutable'", revset),
string.format("jj log --no-graph -r '%s' -T 'immutable' --quiet", revset),
"Error checking change immutability",
nil,
true
@@ -273,5 +273,24 @@ function M.is_change_immutable(revset)
return vim.trim(output) == "true"
end
---
--- Get the commit id from a given revision
--- @param revset string The revset to extract the commit id from
--- @return string|nil
function M.get_commit_id(revset)
local output, success = runner.execute_command(
string.format("jj log --no-graph -r '%s' -T 'commit_id' --quiet", revset),
"Error extracting commit id",
nil,
true
)
-- Test quie
if not success or not output then
return nil
end
return vim.trim(output)
end
return M