JJ-FZF Introduction: Asciicast MP4
JJ-FZF
is a text UI for jj based on fzf, implemented as a bash shell script.
The main view centers around jj log
, providing previews for the jj diff
or jj obslog
of every revision.
Several key bindings are available to quickly perform actions such as squashing, swapping, rebasing, splitting, branching, committing, abandoning revisions and more.
A separate view for the operations log jj op log
enables fast previews of old commit histories or diffs between operations, making it easy to jj undo
any previous operation.
The available hotkeys are displayed onscreen for simple discoverability.
The commands and key bindings can also be displayed with jj-fzf --help
and are documented in the wiki: jj-fzf-help
The jj-fzf
script is implemented in bash-5.1, using fzf and jj with git.
Command line tools like sed, grep, gawk are assumed to provide GNU tool semantics.
Start jj-fzf
in any jj
repository and study the keybindings.
Various jj
commands are accesible through Alt
and Ctrl
key bindings.
The query prompt can be used to filter the oneline revision display from the jj log
output and
the preview window shows commit and diff information.
When a key binding is pressed to modify the history, the corresponding jj
command with its
arguments is displayed on stderr.
This screencast demonstrates how to handle large changes in the working copy using jj-fzf
.
It begins by splitting individual files into separate commits (Alt+F
), then interactively splits (Alt+I
) a longer diff into smaller commits.
Diffs can also be edited using the diffedit command (Alt+E
) to select specific hunks.
Throughout, commit messages are updated with the describe command (Ctrl+D
),
and all changes can be undone step by step using Alt+Z
.
Splitting Commits: Asciicast MP4
This screencast demonstrates how to merge commits using the jj-fzf
command-line tool.
It begins by selecting a revision to base the merge commit on, then starts the merge dialog with Alt+M
.
For merging exactly 2 commits, jj-fzf
suggests a merge commit message and opens the text editor before creating the commit.
More commits can also be merged, and in such cases, Ctrl+D
can be used to describe the merge commit afterward.
This screencast demonstrates varies ways of rebasing commits (Alt+R
) with jj-fzf
.
It begins by rebasing a single revision (Alt+R
) before (Ctrl+B
) and then after (Ctrl+A
) another commit.
After that, it moves on to rebasing an entire branch (Alt+B
), including its descendants and ancestry up to the merge base, using jj rebase --branch <b> --destination <c>
.
Finally, it demonstrates rebasing a subtree (Alt+S
), which rebases a commit and all its descendants onto a new commit.
Rebasing Commits: Asciicast MP4
This screencast demonstrates the Mega-Merge workflow, which allows to combine selected feature branches into a single "Mega-Merge" commit that the working copy is based on.
It begins by creating a new commit (Ctrl+N
) based on a feature branch and then adds other feature branches as parents to the commit with the parent editor (Alt+P
).
As part of the workflow, new commits can be squashed (Alt+W
) or rebased (Alt+R
) into the existing feature branches.
To end up with a linear history, the demo then shows how to merge a single branch into master
and rebases everything else to complete a work phase.
The contrib/
directory contains additional tools or scripts that complement the main jj-fzf functionality.
These scripts are aimed at developers and provide useful utilities for working with jj.
-
jj-am.sh: A very simple script that allows to apply patches to a jj repository.
Usage: ~/jj-fzf/contrib/jj-am.sh [format-patch-file...]
-
jj-undirty.el: A simple Emacs lisp script that automatically runs
jj status
every time a buffer is saved to snapshot file modifications.Usage: (load (expand-file-name "~/jj-fzf/contrib/jj-undirty.el"))
This application is licensed under MPL-2.0.