jjdiff
A TUI that can be used as a diff editor in the jujutsu vcs.
jjdiff will show all changes and allow you to navigate through them and (partially) select them to be included.
jjdiff makes it easy to navigate the diff by having a 2 dimensional cursor that can 'grow' and 'shrink'.
This cursor can operate on 3 levels:
- Change: select an entire change
- Hunk: select a group of edited lines in a file
- Line: select a single edited line in a file
Keybindings
| Command | Key | Description |
|---|---|---|
exit |
escape, ctrl+c or ctrl+d |
Exit the diff editor with status code 1, causing the diff to not be applied. |
next_cursor |
j, down or tab |
Select the next entry. |
prev_cursor |
k, up or shift+tab |
Select the previous entry. |
first_cursor |
g or home |
Select the first entry. |
last_cursor |
G or end |
Select the last entry. |
shrink_cursor |
l or right |
Shrink the cursor. So go from change to hunk and from hunk to line. If the cursor is on an unopened change it will open it first. |
grow_cursor |
h or left |
Grow the cursor. So go from line to hunk and from hunk to change. If the cursor is on an opened change it will close it. |
select_cursor |
space |
Mark everything selected by the cursor to be included. If everything is already marked it will exclude it instead. This will also select the next entry. |
select_all |
a or ctrl+a |
Mark everything in the diff to be included. If everything is already marked it will exclude it instead. |
confirm |
enter |
Confirm the selected changes. |
undo |
u |
Undo the last command. Commands that only affect the UI state like changing the cursor and opening/closing changes are not included in this. |
redo |
U |
Redo the last undone command. Commands that only affect the UI state like changing the cursor and opening/closing changes are not included in this. |
open_all |
o |
Open all changes. |
close_all |
O |
Close all changes. |
Usage
jjdiff is available on pypi. You can use any way you are comfortable installing python applications.
You can then use it by adding the following settings to ~/.config/jj/config.toml:
[ui]
diff-editor = "jjdiff"
diff-instructions = false # not required but recommended
diff-formatter = ["jjdiff", "--print", "$left", "$right"] # to also format diffs using jjdiff
Configuration
jjdiff can be configured in ~/.config/jjdiff/config.toml or at
$XDG_CONFIG_HOME/jjdiff/config.toml if set. The following configuration
options are supported:
diff.deprioritize
This contains a list of gitignore style globs that can be used to deprioritize certain files in diffs. Deprioritizing has the following effects:
- Deprioritized files are always at the end of the diff.
- In
jjdiff --printthe changes in deprioritized files are not shown.
editor.default_open
Controls if changes are by default open or closed. Deprioritized files will remain closed by default even if this setting is set to true. Default is false.
editor.auto_open
When navigating away from an opened change, automatically closes it and opens the next one. Default is false.
format.tab_width
Controls as how many spaces a tab is formatted in the diff. Default is 4.
keybindings
A dictionary mapping command names to lists of keys that should trigger the command. The default value for each command matches the keybindings table shown earlier in this document.
Metadata
Release files for jjdiff 0.6.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| jjdiff-0.6.2.tar.gz | 22.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jjdiff-0.6.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.0 kB
Release files / jjdiff-0.6.2.tar.gz
| Download URL | jjdiff-0.6.2.tar.gz |
|---|---|
| Size | 22.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
645aa3c012def2292d7a0b557cb63f2504d7ef29f3db807dcaf9f65aa581c725
|
|
BLAKE2b-256 checksum How to use checksums |
4df46ad938be55a8dd1e65585af82b1815d90159aa2ce40c09ed5788f6697432
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.
Transparency logRelease files / jjdiff-0.6.2-py3-none-any.whl
| Download URL | jjdiff-0.6.2-py3-none-any.whl |
|---|---|
| Size | 32.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bcc9586fd042e2ecf65e079bd697aadd0110be3cb1d6c2d7c54794c96287a260
|
|
BLAKE2b-256 checksum How to use checksums |
a3e435228aea150bd0b7cbf0342593581727520678f87f2a762e24748d42d63f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.
Transparency logSecurity for jjdiff 0.6.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for jjdiff-0.6.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.