mirror of
https://github.com/zoriya/jj.nvim.git
synced 2026-08-14 15:13:19 +00:00
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:
+20
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user