Skip to content

jj fzf help

Tim Janik edited this page Dec 12, 2024 · 6 revisions

JJ-FZF (0.24.0)

jj-fzf is a text-based user interface for the jj version control system, built on top of the fuzzy finder fzf. jj-fzf centers around the jj log graph view, providing previews of jj diff or jj evolog for each revision. Several key bindings are available for actions such as squashing, swapping, rebasing, splitting, branching, committing, or abandoning revisions. A separate view for the operations log, jj op log, allows fast previews of diffs and commit histories of past operations and enabling undo of previous actions. The available hotkeys are displayed on-screen for easy discoverability. The commands and key bindings can also be displayed with jj-fzf --help and are documented in the jj-fzf wiki.

JJ LOG VIEW

The jj log view in jj-fzf displays a list of revisions with commit information on each line. Each line contains the following elements:

Graph Characters: @: Marks the working copy : Indicates a mutable commit, a commit that has not been pushed to a remote yet : Indicates an immutable commit, that has been pushed to a remote or occurs in the ancestry of a tag. In jj, the set of immutable commits can be configured via the revset-aliases."immutable_heads()" config Change ID: The unique identifier for the changes associated with the revision Username: The abbreviated username of the author Date: The day when the commit was authored Commit ID: The unique identifier for the commit in Git Refs: Any tags or bookmarks associated with the revisions Message: A brief description of the changes made in the revisions

PREVIEW WINDOW

The preview window on the right displays detailed information for the currently selected revisions. The meaning of the preview items are as follows:

First Line: The jj log -T builtin_log_oneline output for the selected commit Change ID: The jj revision identifier for this revisions Commit ID: The unique identifier for the Git commit Refs: Tags and bookmarks (similar to Git branches) for this revisions Immutable: A boolean indication for immutable revisions Parents: A list of parent revisions (more than one for merge commits) Author: The author of the revision, including name and email, timestamp Committer: The committer, including name and email, timestamp Message: Detailed message describing the changes made in the revision File List: A list of files modified by this revision Diff: A jj diff view of changes introduced by the revision

COMMAND EXECUTION

For all repository-modifying commands, jj-fzf prints the actual jj commands executed to stderr. This output aids users in learning how to use jj directly to achieve the desired effects, can be useful when debugging and helps users determine which actions they might wish to undo. Most commands can also be run via the command line, using: jj-fzf <command> <revision>

KEY BINDINGS

Most jj-fzf commands operate on the currently selected revision and are made available via the following keyboard shortcuts:

Alt-A: abandon Use jj abandon to remove the currently selected revision (or divergent commit) from the history.

Alt-B: bookmark Use jj bookmark {create|set -B} to (re-)assign a bookmark name to the currently selected revision (or divergent commit).

Alt-C: commit Use jj commit to describe the currently selected revision and create a new child revision as working-copy.

Alt-D: delete-refs Use jj bookmark list+delete to list, selected and delete bookmarks and tags.

Alt-E: diffedit Use jj diffedit to select parts of the content diff to be kept in the currently selected revision.

Alt-F: split-files Use jj split in a loop to split each file modified by the currently selected revision into its own commit.

Alt-H: toggle-show-keys Display or hide the list of avilable key bindings, persist the setting in jj-fzf.show-keys of the jj user config.

Alt-I: split-interactive Use jj split to interactively select content diff hunks to be split into a new commit. No text editor is invoked and the new commit gets an empty description.

Alt-K: backout Use jj backout to create a new commit that undoes the changes made by the currently selected revision and apply the changes on top of the working-copy.

Alt-M: merging Start a dialog to select parents for a new merge commit, using jj new REVISIONS.... Possibly rebase the working copy after merge commit creation.

Alt-N: new-before Use jj new --insert-before to create and insert a new revision before the currently selected revision (or divergent commit). Creates a new branch for merge commits.

Alt-O: absorb Use jj absorb to split the content diff of the current revision and squash pieces into related mutable ancestors.

Alt-P: reparenting Start a dialog to add/delete parents of the current revision. Also supports jj simplify-parents after reparenting.

Alt-Q: squash-into-parent Use jj squash to move the changes from the currently selected revision (or divergent commit) into its parent.

Alt-R: rebase Start a dialog to configure the use of jj rebase to rebase a branch, source, or revision onto, before or after another revision. Also supports jj duplicate on the source revision before rebasing and jj simplify-parents afterwards.

Alt-S: restore-file EXPERIMENTAL: Start a dialog to select a file from the currently selected revision and use jj restore to restore the file into the working copy.

Alt-T: tag EXPERIMENTAL: Enter a tag name to create a new unsigned, annotated tag at the selected revision with git tag.

Alt-V: vivifydivergent When a revision has more than one visible commit, it becomes a divergent revision. This command uses jj new+squash … to create a new change_id for the currently selected revision, effectively resolving the divergence.

Alt-W: squash-@-into Use jj squash to move the changes from the working copy into the currently selected revision.

Alt-X: swap-commits Use jj rebase --insert-before to quickly swap the currenly selected revision with the revision immediately before it.

Alt-Z: undo Use jj op undo to undo the last operation performed by jj that was not previously undone.

Ctrl-↑: preview-up Scroll the preview window.

Ctrl-↓: preview-down Scroll the preview window.

Ctrl-A: author-reset Use jj describe --reset-author to reset the author and email of the currently selected revision.

Ctrl-D: describe Use jj describe to describe the currently selected revision (or divergent commit).

Ctrl-E: edit Use jj {edit|new} to set the currently selected revision (or divergent commit) as the working-copy revision. Will create a new empty commit if the selected revision is immutable.

Ctrl-F: file-editor Use jj edit to switch to the currently selected revision and opens the files touched by this revision in $EDITOR.

Ctrl-H: help Show the jj-fzf help and key binding commands.

Ctrl-I: diff Use jj diff to view differences between the currently selected revision and the working copy.

Ctrl-L: log Use jj log to browse the history including patches, starting from the selected revision (or divergent commit).

Ctrl-N: new Use jj new to create a new revision on top of the currently selected revision (or divergent commit).

Ctrl-O: op-log Use jj op log to browse the recent operations log. Use hotkeys to change the preview between diff, history and oplog entry mode. Undo the selected operation or restore its working copy into a new commit.

Ctrl-P: push-remote Use jj git fetch --all-remotes and jj git push --tracked to update the local and remote repositories. Pushing needs confirmation after a dry-run.

Ctrl-R: revset-filter Restart jj-fzf using the current query string as new revset for this repository.

Ctrl-T: toggle-evolog Toggle the preview between jj evolution-log and change_id diff view.

Ctrl-U: clear-filter Discard the current fzf query string.

Ctrl-V: gitk Start gitk to browse the Git history of the repository.

Shift-↑: preview-up Scroll the preview window.

Shift-↓: preview-down Scroll the preview window.

SEE ALSO

For screencasts, workflow suggestions or feature requests, visit the jj-fzf project page at: https://github.com/tim-janik/jj-fzf For revsets, see: https://martinvonz.github.io/jj/latest/revsets

Clone this wiki locally