Beyond jj: config & tools ecosystem
Hello! Welcome to "beyond jj," where we'll explore the jj ecosystem: commands, configurations, and tools designed to work with jj. This talk is a follow-up to last year's JJCon presentation, where I surveyed jj configurations across the community. As a quick note about my qualifications, I simply enjoy experimenting with new tools and was fortunate enough to have Steve Klabnik as my roommate, allowing me to contribute to the official jj docs.
This year's talk will focus less on what jj configuration entails and more on what you can do with it once you have jj. We'll begin by examining what you can accomplish using only the pure jj command, then move on to configurations you can apply to enhance its functionality, and conclude by exploring features that exist outside the jj CLI itself.
One of the most exciting aspects of jj is that even without adding any additional tools, helpers, or scripts, you can achieve quite a bit. However, by incorporating custom templates, revsets, and aliases, you can streamline or automate various tasks.
Moving on to features that have moved from configuration to built-in functionality, last year, I discussed jj tug, an alias that found the closest bookmark and moved it to the closest pushable change. Now, however, we have bookmark advance (and its shortcut jj b a) which performs the same task. By default, bookmark advance will advance the bookmark to the working copy, but if you prefer the version of tug that only advances to the closest pushable commit, you can configure revsets.bookmark-advance-to to match that behavior.
Another significant improvement is the integration of jj bisect tooling, which previously required a wrapper script. Now, you can easily bisect run, automatically identifying the change you're trying to bisect. This was a previously significant functionality gap between jj and git, and I'm delighted that it's now integrated seamlessly within jj, without the need for fiddling or hunting down scripts.
For those who don't need bisection but still want to run a script to modify every change in a revset, jj run is the solution. Provide a script and a revset, and the script will be executed, updating every change if any files were modified. Importantly, the entire tree of changes remains unchanged during this process (or, conversely, it's automatically rebased as the run progresses through each change).
However, it's crucial to note that jj fix and jj run are not the same thing. While both aim to update a range of changes by modifying the files within those changes, jj fix specifically targets files that were changed, creating a checkout of each change and passing a modified version of the file to the script one at a time. In contrast, jj run operates on files that are currently checked out on disk.
Another notable addition to jj is jj tag, which moves functionality from git to jj itself. You no longer need to rely on git tags for managing your tags. Instead, you can use jj tag set and jj git push --all to push all of your bookmarks and tags simultaneously. Additionally, you can push a single tag using jj git push --tag NAME. This integration simplifies your daily workflow by eliminating the need to run git commands entirely.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.