Cheatsheet for jj's builtin diff editor
I grepped the scm-record
repo for command names I was familiar with, and,
finding the ui.rs
source that maps key strokes and mouse clicks
to commands, I extracted them into a cheatsheet-style layout suitable for
quick reference while learning and using jj
's built-in diff editor.
If you're like me, then lately you've been using the new VCS kid on the block,
jj
. And if you're really like me, then you have encountered the built-in diff
editor when doing a revision split (jj split
) or when doing the so-called
squash workflow (interactively via jj squash -i
). (There may be other ways
that jj
brings up the TUI, which, confusingly, the docs refer
to as
scm-diff-editor
, but is actually named
scm-record
[EDIT: scm-record
is
the library and scm-diff-editor
the binary (name
explanation),
but if you're using jj
you don't really need to know this], seeming to have
been renamed in the past year sometime, but I'm not aware of them.)
And if you're really, really like me, then when you were presented with
the diff editor in your terminal upon executing one of those commands, you
were frustrated and felt dumb as you mashed keys and tried to understand
what you were supposed to do and how. It's a spartan interface, and as far
as I can tell, and I certainly tried to tell, because I queried the usual
search indices and other knowledge resources, and combed the jj
docs,
and noted the apparent complete lack of scm-record
docs, there is not much
yet out there in the public to help you through editing a diff with it and
ultimately amending your jj
commit. I don't fault those involved, it's a
young and maturing project, and the editor itself is a separate effort from
jj
, but seeing as how it is a key step in the recommended way of using
jj
,
I needed more help. (Incidentally, Steve's doc linked there was the only
documentation I was aware of when I trying to figure this out, so I appreciate
him for providing a practical example).