Editing changes in patch format with Jujutsu

One tiny script, big vibes: JJ fans cheer, Magit faithful hold the line

TLDR: A dev scripted Jujutsu to edit a single change as a patch, showing off JJ’s plug-in power. The crowd is split: fans praise JJ’s elegant extensibility, while Magit loyalists say, “Nice hack, but my fingers aren’t switching,” highlighting the real obstacle—tools are easy, habits are hard.

A developer just pulled a neat trick: they used Jujutsu (a newer Git-like tool) to edit a single change as a patch in their editor—no messy file juggling. They wired JJ’s “diff edit” feature to a custom script that generates a patch, opens it, lets you tweak, then reapplies it cleanly. No, JJ doesn’t ship Git’s format-patch/apply flow, but this hack gets you there—with flair. The crowd reaction? Split and spicy. One camp is swooning over JJ’s flexibility. As commenter danpalmer gushes, JJ’s extension system is so well-designed that clever add-ons feel native. The vibe: “JJ devs, take a bow.” The other camp is clutching their keyboards. RMPR summed it up: they want to love JJ, but their fingers are married to Magit—an insanely popular Git interface for Emacs—and JJ’s current frontends aren’t “there” yet. Cue memes about being “locked in” by muscle memory and the eternal battle of cool new toys vs. the tools you actually ship with. In short: JJ just showed off its agility, but the adoption story runs through habits, keybindings, and a Magit-shaped comfort zone. Place your bets: Jujutsu elegance or Magit muscle memory

Key Points

  • The article presents a method to edit a single Jujutsu change by integrating a custom external tool with jj diffedit.
  • Jujutsu lacks direct equivalents to Git’s git format-patch and git am workflow for patch editing.
  • A Bash script generates a unified diff between jj’s provided left/right directories, opens it in $EDITOR, and reapplies the edited patch.
  • The script reverses the original patch on a copy of the 'right' directory and applies the edited patch, avoiding modifications to the read-only 'left'.
  • Registering the script in jj’s config under merge-tools enables jj diffedit --tool=patch to replace the change’s content with the edited result.

Hottest takes

"JJ has a good, well thought out interface for extension" — danpalmer
"The hipster in me wants to adopt it" — RMPR
"My muscle memory is wired to Magit… none of the frontends for jj comes close" — RMPR
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.