Start here after choosing a revision in the log. These inspection workflows share the repository and revision context of the buffer that opened them, but some editing and recovery actions are explicitly identified below.
Diffing
Diff Transient
- Key: d (majutsu-diff)
Open the Diff transient.
Useful transient entries include:
- Key: r
Select revisions to diff (
--revisions). Can specify multiple revisions or a revset likeB::D.- Key: f / t
Select the
--fromand--torevisions.- Key: --
Limit diff to selected files/filesets. Completion shows full repository-relative paths changed by the active
--revisionsor--from/--toselection. Without an explicit selection it uses revisions in the active log region, then the revision at point, and finally@. Fileset expressions remain free-form and can still be entered directly.- Key: -g
Toggle Git-style diff output.
- Key: -W
Toggle color-words diff output.
- Key: -S
Toggle stat output.
- Key: -s
Toggle summary output.
- Key: -c
Set context line count.
- Key: -b / -w
Ignore whitespace amount / ignore all whitespace.
- Key: W
Save the current diff arguments as defaults for this jj repository.
Understanding --revisions
The --revisions argument accepts any revset that forms a contiguous set of
commits. "Contiguous" means no gaps in the DAG, but forks and merges are
allowed.
Examples:
-r @Changes in the working copy commit (default).
-r @-Changes in the parent of the working copy.
-r B::DTotal changes from B through D.
-r 'A | B'Valid only if A and B form a contiguous set; gaps produce an error.
When visiting a file from such a diff, Majutsu uses the exact range stored by the diff buffer:
On an added or context line: resolve the
--revisionsexpression itself.On a removed line: resolve the parents of that expression (
REVSET-in revset syntax).
Blob buffers require that the chosen side resolve to exactly one revision. Majutsu reports an error rather than arbitrarily choosing one head or root.
Note: When the revset has multiple heads or roots, the target revision for file visits may be ambiguous. For example, in an X-shaped history:
D E <- two heads
\ /
C
/ \
A B <- two roots
If you diff -r A::D | B::E, there are two heads (D, E) and two roots (A, B).
The diff shows changes from the merged parents to the merged heads. If D
and E modify the same lines, the diff can show conflict markers. Inspection of
the combined diff still works, but visiting a blob from either ambiguous side
fails the single-revision check. Use --from / --to with single revisions
when precise file navigation matters.
Diff Buffer
The diff buffer is highly interactive:
For a diff of exactly one change, Majutsu displays collapsible revision
headers and the change description above the diff. This includes the default
working-copy diff and an explicit -r or --revisions revset that resolves to
one change. The metadata is omitted for --from / --to ranges and revsets
that resolve to zero or multiple changes. Bookmark labels use structured jj
template fields available in every supported jj version, so remote-only
bookmarks and names containing spaces, sigils, or @ are preserved. Control
characters are escaped when rendered to keep the collapsible heading on one line.
- Key: RET (majutsu-diff-visit-file)
Visit the appropriate version of the file at point. For working copy diffs, added/context lines visit the workspace file while removed lines visit the parent-side blob. For committed changes, it visits the blob at the corresponding side.
- Key: C-j / C-<return> (Vanilla) (majutsu-diff-visit-workspace-file)
Visit the workspace file, regardless of diff type.
- Key: C-<return> (Evil) (majutsu-diff-visit-workspace-file)
Visit the workspace file without conflicting with Evil's
C-jsection navigation.- Key: - (Vanilla) (majutsu-diff-less-context)
Decrease the context for diff hunks by COUNT lines.
- Key: = (Evil) (majutsu-diff-less-context)
Decrease the context for diff hunks by COUNT lines.
- Key: + (majutsu-diff-more-context)
Increase the context for diff hunks by COUNT lines.
- Key: 0 (Vanilla) (majutsu-diff-default-context)
Reset the context for diff hunks to the default height.
- Key: ~ (Evil) (majutsu-diff-default-context)
Reset the context for diff hunks to the default height.
- Key: t (Vanilla) (majutsu-diff-toggle-refine-hunk)
Toggle word-level refinement.
- Key: T (Vanilla) (majutsu-diff-toggle-fontify-hunk)
Toggle syntax highlighting within diff hunks. With a prefix argument, cycle between highlighting the current hunk on selection and highlighting all hunks immediately.
When Evil mode is active, Majutsu follows evil-collection's
conventions for Magit diff buffers: + still increases context, =
decreases it, and ~ resets it to the default.
When --color-words is enabled, Majutsu renders the old/new line numbers in
the left margin and uses "..." lines to split hunks.
With refinement enabled, color-words hunks also show a shadow cursor on the
paired side (controlled by smerge-refine-shadow-cursor).
With Vanilla bindings, file visits through RET or C-j still respect the
side at point by using stored line/column metadata from the color-words
backend.
With Evil bindings, RET visits the side at point and C-<return> forces the
workspace file; C-j remains section navigation. File visits use the same
stored line/column metadata from the color-words backend.
File and Blob Inspection
Majutsu's file inspector is implemented by majutsu-file and can be used both
from command prompts and with defaults derived from the current section context.
Commands:
- Command: majutsu-find-file
Prompt for revset + path (defaulting from point when possible) and open that file as a blob.
- Command: majutsu-find-file-other-window
Like
majutsu-find-file, but display the blob in another window.- Command: majutsu-find-file-other-frame
Like
majutsu-find-file, but display the blob in another frame.
Blob buffers are read-only snapshots with history-aware navigation:
- Key: p / n (majutsu-blob-previous / majutsu-blob-next)
Jump to the previous or next revision that touched this file, while preserving cursor position as much as possible.
- Key: V (Vanilla) (majutsu-blob-visit-file)
Jump to the workspace version of the same file.
- Key: C-c m (majutsu-blob-visit-magit)
Open the current blob in Magit's blob viewer.
- Key: b (majutsu-annotate-addition)
Start annotate for the current blob.
- Key: g (Vanilla) (revert-buffer)
Revert or reload the current blob content.
- Key: g r (Evil) (revert-buffer)
Revert or reload the current blob content.
- Key: e / C-x C-q (majutsu-blob-edit-start)
Enter editable blob mode (wdired-style).
Blob navigation keys are disabled while editing, so blob-mode bindings do not interfere with text edits.
- Key: C-c C-c (majutsu-blob-edit-finish)
Apply changes through non-interactive
jj diffeditand exit edit mode. Majutsu copies current buffer text into the diffedit right side and finishes automatically, without opening the right-side temp file buffer.- Key: C-x C-q (majutsu-blob-edit-exit)
Leave editable mode. If modified, it prompts to save or abort; if unchanged, it exits immediately.
- Key: C-c C-k (majutsu-blob-edit-abort)
Abort blob edits, restore the original content, and restore the original cursor position.
Evil normal-state behavior depends on whether the blob is read-only or editable:
- Key: i (majutsu-evil-blob-insert-dwim)
Enter editable blob mode and stay in normal state.
- Key: i (evil-insert-state)
Enter insert state.
Editable mode also changes cursor visuals (see
majutsu-blob-edit-cursor-type); with Evil, the normal-state cursor is updated
too.
Annotate (Blame)
Majutsu annotate is implemented by majutsu-annotate and uses
jj file annotate under the hood. The navigation bindings below belong to
majutsu-annotate-read-only-mode, which is enabled by default through
majutsu-annotate-read-only. Setting that option to nil keeps ordinary file
buffers editable with their editing bindings; revision blob buffers remain
read-only snapshots.
- Key: b (Vanilla) (majutsu-annotate-addition)
Enter annotate from a blob buffer. From an ordinary file buffer, use
M-x majutsu-annotate-addition. When invoked again on an annotated chunk, jump to its parent revision (when available) and re-annotate there.- Key: c (majutsu-annotate-cycle-style)
Cycle heading/highlight/line styles (see
majutsu-annotate-styles).- Key: n / p (Vanilla) (majutsu-annotate-next-chunk / majutsu-annotate-previous-chunk)
Move to the next or previous chunk.
- Key: C-j / g j / C-k / g k (Evil) (majutsu-annotate-next-chunk / majutsu-annotate-previous-chunk)
Move to the next or previous chunk.
- Key: N / P (Vanilla) (majutsu-annotate-next-chunk-same-commit / majutsu-annotate-previous-chunk-same-commit)
Move to the next or previous chunk from the same commit.
- Key: g J / g K (Evil) (majutsu-annotate-next-chunk-same-commit / majutsu-annotate-previous-chunk-same-commit)
Move to the next or previous chunk from the same commit.
- Key: RET (Vanilla) (majutsu-annotate-show-commit)
Show the chunk's revision diff.
- Key: M-w (majutsu-annotate-copy-hash)
Copy the chunk change-id.
- Key: SPC (Vanilla) (majutsu-annotate-show-or-scroll-up)
Scroll the diff window up if it is already open.
- Key: S-SPC (majutsu-annotate-show-or-scroll-down)
Scroll the diff window down if it is already open.
Ediff and Diffedit
- Key: ? E (Vanilla) (majutsu-ediff)
Open the Ediff transient.
- Key: E (Evil) (majutsu-ediff)
Open the Ediff transient.
Selection: choose revisions via --revisions or --from / --to (with
point-toggle variants). In diff buffers, current range is used as default.
- Key: e (majutsu-ediff-dwim)
Compare based on context (hunk, file, commit, or whole buffer).
- Key: E (majutsu-ediff-edit)
Run
jj diffeditwith Emacs asui.diff-editor. If no file is at point, Majutsu prompts for a changed file, then launches a two-sided Ediff session for that single file (left/right temp files). Edit the right-side temp file and quit Ediff to return control tojj diffedit. Whenmajutsu-diffedit-finish-on-saveis non-nil, saving a diffedit temp file can finish the with-editor session automatically.- Key: m (majutsu-ediff-resolve)
Resolve conflicted files. In a
jj-commitsection, it lists conflicted files for that revision; otherwise it uses working copy@. Usesjj resolvewith 3-way Ediff (merge tool:$left,$base,$right) for up-to-2-sided conflicts, and falls back tojj diffeditfor conflicts with more than 2 sides. In this flow, quitting Ediff without editing leaves jj's output unchanged, so the conflict stays unresolved. If you edited and quit, Majutsu asks whether to save the resolved result; choosing no discards edits and keeps conflicts. When only part of a conflict is resolved, remaining regions are written with git-style conflict markers so jj keeps unresolved regions unresolved. Conflict-file completion preserves exact repository paths and annotates each candidate with its conflict side count.- Key: M (majutsu-ediff-resolve-with-conflict)
Open the resolve target buffer (working-copy file or revision blob), enable
majutsu-conflict-mode, and jump to the first conflict.
Resolve entry points are available both from the Ediff transient and as direct commands:
- Command: majutsu-ediff-resolve
Resolve conflicted files using the default Ediff-based flow.
- Command: majutsu-ediff-resolve-with-conflict
Open the conflict target directly and enable
majutsu-conflict-mode.
Process Buffer
- Key: $ (Vanilla) (majutsu-process-buffer)
Show the current repository's process buffer. It retains recent synchronous and asynchronous
jjcommands, including failures and long-running remote operations.- Key: ` (Evil) (majutsu-process-buffer)
Show the current repository's process buffer. It retains recent synchronous and asynchronous
jjcommands, including failures and long-running remote operations.
Operations
- Key: X (majutsu-op-transient)
Open the operation dispatcher with log, diff, restore, revert, undo, and redo actions.
- Key: v (Vanilla) (majutsu-evolog)
Open the evolution log for the revision at point.
- Key: ? v (Evil) (majutsu-evolog)
Open the evolution log from the Majutsu dispatcher. Contextual
vremains available in operation diff buffers.- Command: majutsu-op-log-transient
Open the operation-log menu. Supports
--limit,--reversed, and--no-graph.- Command: majutsu-op-log
View Jujutsu's operation history with its graph preserved by default. Rows mirror jj's compact operation format: normal and snapshot operations show short id, user, workspace, elapsed time, description, and all attributes; the root shows only its short id and
root(). Full ids and canonical metadata remain available to actions and the shared? wcopy submenu. Read-only operation views pass--at-op=@ --ignore-working-copyto avoid snapshotting while browsing. Pressdto open an operation-diff transient prefilled from point,uto restore, orrto revert;RETkeeps the ordinary Majutsu visit behavior.- Command: majutsu-op-diff-transient / majutsu-op-diff
Compare repository changes by operation,
--from, or--toin a sectionized changed commit/ref view. Explicit--from/--toranges show lightweight metadata for both endpoint operations, including their full ids, user, workspace, end time, and description. Changed lines keep full commit/change IDs internally. PressRETorvon a changed line to open its evolution log; elsewhereRETkeeps ordinary Majutsu visit behavior, anddremains the ordinary Majutsu diff command. Operation metadata plus this diff view replace a separate operation-show buffer.- Command: majutsu-evolog
View
jj evologwith its graph preserved and each entry parsed through Majutsu's structured row protocol. It is also available as? vin the dispatcher. Entries mirror jj's compact evolog format; full change, commit, and optional operation IDs are hidden metadata available through? w. PressRETto open jj's native Git-format inter-diff for the entry (usingjj evolog --patch --git);dremains the ordinary Majutsu diff command.- Commands: majutsu-op-restore / majutsu-op-revert
Restore to an operation or revert an individual operation after confirmation.