Majutsu: Bridging Emacs and Jujutsu with Magit-Inspired Workflow
#Regulation

Majutsu: Bridging Emacs and Jujutsu with Magit-Inspired Workflow

Tech Essays Reporter
4 min read

Majutsu brings Magit's legendary Git interface to Jujutsu, offering Emacs users a powerful, keyboard-driven workflow for the emerging VCS.

For Emacs users who have fallen in love with Magit's elegant Git interface, the emergence of Jujutsu (jj) as a modern VCS presented both excitement and a challenge: how to maintain that same level of efficiency and keyboard-driven workflow in a new version control system. Enter Majutsu, an Emacs package that brings the Magit philosophy to Jujutsu, offering a familiar yet distinctly modern interface for interacting with JJ repositories.

The Magit Philosophy in a New Context

Magit has long been celebrated in the Emacs community for transforming Git from a command-line tool into an interactive, visual experience that feels native to Emacs. Its keybindings, transient menus, and buffer-based navigation have become second nature to many developers. Majutsu takes this proven approach and applies it to Jujutsu, a VCS designed to address some of Git's limitations around branching, merging, and collaboration.

What makes Majutsu particularly interesting is how it adapts Magit's concepts to Jujutsu's unique workflow. While Git's model revolves around commits, branches, and remotes, Jujutsu operates on a different paradigm with changesets, branches, and operations. Majutsu bridges this conceptual gap while maintaining the keyboard-driven efficiency that Magit users expect.

Installation and Getting Started

The installation process reflects modern Emacs package management practices. For Doom Emacs users, adding (package! majutsu :recipe (:host github :repo "0WD0/majutsu")) to packages.el is sufficient. Users of use-package with straight.el can use (use-package majutsu :straight (:host github :repo "0WD0/majutsu")), while those on Emacs 29+ with package-vc can simply use (use-package majutsu :vc (:url "https://github.com/0WD0/majutsu")).

Once installed, the workflow is straightforward: open a JJ repository with M-x majutsu or M-x majutsu-log, then navigate using n and p to move between revisions. The RET key visits items, and ? provides context-sensitive help. This immediate familiarity for Magit users is one of Majutsu's greatest strengths.

A Deep Dive into the Interface

The keybindings in Majutsu are thoughtfully designed to mirror Magit's conventions while accommodating Jujutsu's specific operations. Navigation remains simple with n and p for next and previous revisions, but the action keys expand to cover Jujutsu's unique features.

In blob buffers, Majutsu shines with its editing capabilities. Pressing e enters editable mode, and saving applies changes via jj diffedit—a workflow that feels natural to Emacs users while leveraging Jujutsu's sophisticated change management. Interestingly, i in Evil mode also enters editable mode, showing attention to different Emacs user preferences.

The annotation feature (b in blob buffers) and the ability to open blobs in Magit (C-c m) demonstrate how Majutsu doesn't exist in isolation but rather integrates with the broader Emacs ecosystem. This interoperability is crucial for users who work with both Git and Jujutsu repositories.

Essential Operations at Your Fingertips

The command palette in Majutsu covers the full spectrum of Jujutsu operations:

  • Navigation: n/p for revisions, g for refresh
  • Operations: c for commit, d for diff, E for Ediff, r for rebase
  • Workspace management: Z for workspaces, C-/ and C-? for undo/redo
  • Advanced: a for absorb, s for squash, S for split, y for duplicate

This comprehensive coverage means users can perform virtually any Jujutsu operation without leaving Emacs, maintaining the flow state that makes Magit so beloved.

Technical Requirements and Dependencies

Majutsu requires Emacs 29.1+ and Jujutsu v0.37.0+, ensuring compatibility with modern versions of both tools. The package depends on magit, transient, and with-editor, leveraging these well-maintained libraries rather than reinventing the wheel. This approach not only reduces maintenance burden but also ensures consistency with the broader Magit ecosystem.

Documentation and Community

The project provides comprehensive documentation through a user manual, version history in NEWS, and third-party notices detailing upstream adaptations. The licensing transition from MIT to GNU GPL v3+ reflects the project's evolution and commitment to open-source principles.

Majutsu's origins as a fork of jj-mode.el by Brandon Olivier, combined with its dependence on and inspiration from Magit, create an interesting lineage. It represents a community-driven effort to bring modern VCS workflows to Emacs users who value efficiency and keyboard-driven interfaces.

The Future of VCS in Emacs

As Jujutsu continues to mature and gain adoption, tools like Majutsu will play a crucial role in making the transition from Git smoother for Emacs users. The package demonstrates how the principles that made Magit successful—keyboard efficiency, visual clarity, and deep integration—can be applied to new tools and paradigms.

For teams considering Jujutsu or developers curious about modern VCS alternatives, Majutsu provides a compelling on-ramp. It allows users to explore Jujutsu's benefits while maintaining the familiar Emacs workflow they've come to rely on. As version control continues to evolve, the ability to adapt beloved interfaces to new systems will be increasingly valuable.

Featured image

The Majutsu interface, showing the familiar Magit-style layout adapted for Jujutsu operations.

Comments

Loading comments...