cbrst/nix
Workflows

Working with jj

How this repository and the configured tools use Jujutsu.

This repository, like most of the user's repositories, is managed with Jujutsu (jj) and colocated with Git. Git sees a detached HEAD; that is expected.

Mental model

  • The working copy is a commit, @. There is no staging area; edits are part of @ automatically.
  • After jj commit, the finished change is @- and @ is a new empty change.
  • Bookmarks (jj's branches) do not move by themselves. main is moved explicitly or by the sync alias's push of the current stack.

Everyday commands

jj status          # what changed in @
jj diff            # the diff of @
jj logn            # local, unpublished work on top of trunk
jj commit          # describe @ (with an AI-drafted message) and start a new change
jj pull            # fetch, then rebase the local stack onto trunk
jj sync            # pull, then push the current stack's bookmarks

logn, pull, and sync are aliases defined by the VCS module.

Tooling that understands jj

Tooljj support
ZshPath completion falls back to files, so jj diff m/h/f<Tab> expands
PromptOh My Posh shows a jj segment with the change ID
NeovimNeoJJ for status, commit, log, and more; jj diff counters in the statusline
EmacsBlazingjj from SPC g g
ShellBlazingJJ terminal UI
Claude CodeGlobal context and the idiomatic-jj skill steer it to jj commands
Commit messagesThe drafting hook works in jj's editor

Last updated on

On this page