I've been adding jj helpers to zsh quite a bit lately. Here are a few of my favs:

  • jl — log from fork point with trunk up to @ (the current branch slice)
  • jll — full jj log
  • jl-unmerged — your commits not yet in trunk
  • jl-unpushed — your commits not in any remote bookmark
  • jl-heads-mine / jl-heads-all — DAG heads, yours vs. everyone's
  • jbl-untracking — bookmarks that exist locally but aren't tracking a remote (set difference of all vs. tracked)
  • jj-abandon-empty — abandon empty mutable commits except @
  • jl-bookmark <b> — log the slice from fork point up to bookmark b
  • jl-origin <b> — show closest and all bookmarks containing b's fork point (i.e. where it branched off)
  • jl-contains <rev> — same idea but for any revision: which bookmarks contain it
  • jj-push <bookmark> [rev] — set bookmark to rev (default @) and jj git push -b it. Has zsh completion for both args.
  • ghpr <issue> [target=staging] — create a PR for the bookmark whose name contains the issue number. Issue arg accepts 123, tigger#123, issues#123, or org/repo#123. Title is pulled from gh issue view; body is closes <repo>#<issue>.
  • _jj_prompt — renders the shell-prompt jj segment. Walks from the nearest bookmark ancestor to @ in a single jj log call:
    • on a bookmark commit: shows the bookmark name, with if it's ahead of its remote
    • off a bookmark: shows name +N where N is commits past the nearest bookmark
    • no bookmark ancestor: falls back to short change id with (empty), (conflict), (divergent) markers