211 points · by renehsz · 1w ago · 197 comments
However I mostly use it backing on to a custom VCS, not git. I can't wait to see some JJ-native forges that don't try to keep it compatible with git, I think there's a lot more benefits and more UX to be explored there!
JJ has the potential to be a substantial step forward in performance. This will depend on the backend to fully realise it, but a backend that prioritises scalability could vastly outperform git and GitHub's storage.
I think in the post-Microsoft acquisition, post-Dear GitHub letter era, GitHub's shine has worn off. I see a lot more use of GitLab for open source, a lot more use of various other forges. I don't think it's a requirement for a thriving open source project in the way it was for ~2010-2020.
If Mercurial was better than Git it would have won the distributed versioning system war.
I remember Mozilla picking Hg instead of Git to migrate from CVS, and most people were unhappy about it because they prefered git.
At the time there were a couple of low-key Mercurial server solutions: bitbucket, and another I can' quite recall. And then there was Github.
At the time it very much felt like the HN/Silicon Valley hype-cycle/publicity bandwagon jumped on Github. That's really what won 'the war'.
It's a bit like saying, if betamax was better than VHS it would have one the video battles.
Back in the day, Windows was still 'king' and Mercurial was Windows friendly, and git really wasn't, and that still wasn't quite enough.
Ah, so Windows is better than Linux/UNIX and MacOS. Got it.
Basing code review on changes and changesets would mean that the evolution of each change could be seen in isolation, which would also mean that you immediately do away with awkward workarounds like PR stacks.
(I am the author)
I really don't like the automatic bookmark naming thing.
I'm also skeptical about automatic rebasing, but having conflicts not block the process could be nice, I'll have to try it out on more complex trees.
Also, I didn't see a section on workspaces, but I assume they basically do the right thing.
I keep running into people who “just commit stuff” and they don’t know what they are doing.
Downside is we are heading into direction where people don’t even read code anymore so I might be just old man screaming at the clouds or agents.
Indeed. One nice thing about this is you can have a staging area for the staging area (repeat ad nauseum). It's not that unusual that I treat a commit as the staging area, and then I want to do something experimental on top of it, and make a new commit on top of my staging area and try things out there - ultimately to squash into my main staging commit.
In my last job I gave a presentation on jj and I hammered this point. I said it's like git but with everything version controlled. The index/staging is version controlled. The stash is version controlled. Technically even things like setting/unsetting bookmarks, commit descriptions etc are version controlled.
1. I write some code.
2. I realise it makes sense to commit as two commits.
3. I stage changes for the first commit & commit it.
4. I stage the remaining changes and commit those.
How would that work in JJ? I guess you do things in a different order somehow?
With the staging area, you don't even know if the commit builds if you commit selectively, and manual adding is error-prone.
The traditional "clean" way has been to stash unwanted changes temporarily, then commit the rest.
I get conceptually why it’s desired to have things build properly on every commit but I just haven’t seen people actually make use of that. In my team’s current code base, we have the commits in a given PR auto-squash down into one commit which I’ve liked quite a bit
You should always use server-side CICD.
> and manual adding is error-prone
That's a UI problem. I've been manually selecting code with Magit for years and it's very effective.
git commit foo bar/
To commit my changes to foo and bar/* but not baz. Also pairs well with -p.At first the auto-staging (or whatever it's called) is annoying. It sure is if one is used to dump random files in the repository, that haven't been ignored.
After some time, I realised it gives a lot of freedom. Working on something but not in a workspace, and need to do something else for the day? Just jump somewhere else. Everything will still be there when you get back. In other words, it's hard to lose things by mistake. In those situations it's also cool to describe (name) the work being done, prior to making a normal commit. A bit odd but one can also push `@` to a remote (e.g. iterating on something and piggy backing on a CI-system), avoiding having to squash and then push.
Having a stack of PR's, then rebasing it all to see a conflict, and only having to deal with it one is also magical.
Moving bookmarks around can be annoying.
Workspaces work fine, and there's two options:
- the normal ones, where a full .git isn't created. That works fine, unless having tooling that expects the workspace to also work as a git repository, in which case ..
- you can make the workspace collocated, less lightweight, but git tooling works
JJ lets you freely move through the history.
That's only when you're pushing, and you can always explicitly name it. I've never done an automatic bookmark.
> I'm also skeptical about automatic rebasing
Automatic rebasing is one of the best things about jj. I rely on it so much (just jump back to the commit with the bug and fix it right there) that I don't think I'd be happy with any version control system that doesn't have it.
Does jj have something like git rerere?
Automatic bookmark naming is 100% cursed, I always name them, and also don't subscribe to this weird one commit per-bookmark/PR thing people seem to have adopted. You can use bookmarks just like git branches in practice.
Rebasing is so much nicer than doing the same thing with git because its going to do its best to finish the job, then leave you with a coherent set of conflicts you can clean up one commit at a time. Its still conflict resolution, and it still sucks, but at least you feel less like you're fighting the tooling.
Finally, workspaces exist and work reasonably well. Annoyingly Claude Code specifically has real trouble interacting with them, and last I tried in agent mode refused to accept that a jj workspace is just as valid a mechanism as a git workspace. They may have fixed that by now, its been a while since I tried.
Git feels like running with leaden shoes by contrast.
At the start of the day, I resumed working on a feature; there's no staging, so modifications I make are all stored as the current change.
Later that day I realised I needed to actually save the version of the feature that existed when I started work that morning.
So into the evolog I go (`jj evolog`). It's a record of all commits that a change has been; I could scroll back through the recorded changes, find the first change made that day, and then 'jj new' to create a change that represents that work.
It felt magical, to just be able to jump back to a project state that I didn't explicitly record, then save it.
The jj log graph is very nice visually in the terminal.
One of the nice things about jj is you don't need to name a branch. You're just working on a graph. When you think you have something consistent and would like to give a name to it, you can do it (before or after the fact). But the lack of friction in creating a temporary new branch is amazing.
If you used VCS before git and loved how easy branching is in git, this is the same feeling in jj, but now with git being the old, tedious way.
So it's the "oh no, I realise now that I needed to commit before I made all those changes" situation, but since the workspace gets snapshot/committed on every jj command, nothing was lost.
I'd be OK if I had to immediately (blocking any operations) choose whether to add or (locally) ignore the file, but auto-add isn't for me.
jj config set --user snapshot.auto-track "none()"Or edit the commit if you just want to make a quick fix you know you'll want to squash immediately.
I recently created a project which utilizes FUSE to serve git files directly from object store without a checkout. Main motivation was to sepeedup a worktrees creation (I work on a huge monorepo). In my case it helps a lot - now I wait a second instead of a minute. But then I realised there are other interesting features which having vfs opened:
- tree structure of related branches (simplest case of that are stacked PRs) which rebases itself
- live preview of merge state or any node of such tree
- on demand creation of a new branch which merges any of the existing ones very cheaply (e.g for a throwaway build check)
- quick and simple comand which shows conflicting files between selected worktree and all others
- agents gets notified about such conflicts when they happen
I was able to design it in a way so git sees those virtual workspaces as normal worktrees, and all git commands works exactly as you would expect. So I think for some people, especially on the very big repositpries, it might solve a few problems they try to solve with jj.
https://github.com/pkukielka/gitfold
A few typical use cases: https://github.com/pkukielka/gitfold/blob/main/docs/guide.md
I think in truth I 50% of the reason I made it was because I was mad about Anthropic inventing a whole new vcs after blaming git clone speed. I also knew artifact-fs exists, which works lazily to get data on demand, which is cool. https://github.com/cloudflare/artifact-fs https://news.ycombinator.com/item?id=47792374
this for some reason gives me clearcase vibes...shudder.
jj just makes everything so much easier. But more than that, it has capabilities that are not available in git - eg how it deals with conflicts. There's tons of guides and essays out there about all of this so I won't try to enumerate all the differences
There would surely be some uncomfortable learning period, but it is worthwhile. jjui makes it that much easier too.
Bad ergonomics-- terrible languages, clunky linters, complicated VCS-- can be offloaded to the clanker but the cost is still there. A clanker fighting to un-foobar a git repo is a clanker that spending tokens and coherence on not-the-thing-you-wanted.
One of the best ways I have seen to "clear the head" of a robot is to provide better tooling that requires less cognitive burden-- for the user, or in markdown skills, its all the same.
Clearly other people are delighted with jj though.
Perhaps the value becomes clear on larger teams, big monorepos?
I find it incredibly useful as an individual contributor opening many PRs on a single upstream project. I can rebase all my PRs onto new upstream changes in one go, I can easily keep the commit graph neat, I can easily squash changes down into specific PRs while keeping my working tree positioned after they all merge together. Really speeds up my workflow, it's awesome. And it's really cool that merge conflicts don't block operations. It's really limiting that git has only one active branch at a time.
- e.g. tracks everything by default; this is an advantage compared to "oops I forgot to check it in".
- e.g. reworking feature branches is more natural in jj compared to rebasing in git.
I expect I've just internalized all these idiosyncrasies after so long.
WRT the model: JJ has a DAG of mutable changes. Git has a DAG of immutable commits, a mutable staging area, and a mutable stash.
The rest is probably a bit more of a tradeoff for many people in that jj like git also has a non-traditional mental model that you have to learn, with the difference that there is actually rhyme and reason behind jj's. But whether learning that (which can be a non-trivial effort) is worth it to you if you're already accustomed to git idiosyncrasies is a personal decision.
There's lot's of jujutsu tutorials that teach you how to undo operations and write commit messages before the commit, but almost none cover what to do with all this power.
It's easy to name some general principles like “it should be easy to read” but I don't think it helps, especially if you're a novice like me.
As an example, you might end up with "Refactor to facilitate adding feature X", "Data models for X", "API endpoints for X", "UI for X". Each of those would contain all the code/tests/documentation for each of those steps.
The nice thing about jj is that it makes it really easy to have a bunch of messy commits locally as your bouncing around the place, followed by squashing/splitting things as appropriate. In practice that first refactor commit might only come into existence very late after you've built a bunch of endpoints and done some refactoring along the way.
jj gives you excellent tools to change your mind mid-way.
just treat your stage as the real project and worktree as some ephemeral sandbox. as you work build your index in stages by `git add -e` and removing your debug harness hunks. as soon as you reach a milestone, just commit and type your message when the context is fresh in your head.
with jj, you work all day and finally when you are ready to commit, you now have to manually remove your debug harness, remove build artefacts, and reverse engineer your own code to write a commit message when you just want to go home.
stop treating the stage as a implementation detail poking out into userspace. if it was just a implementation detail, linus wouldn't have defended it so fiercely.
In practice I usually just use `jj commit -i`, where you just select the files you want to keep there, edit / add the description (commit message) and a new change is created on top for your new working area.
> compiler artefacts, build files
I agree with my sibling those should be .gitignored and if not, yes those those may cause problems with `jj`
> debug harness
I think that works pretty well with `jj` actually. Let's say mid work you're interrupted and needs to check a an commit. `abc` is your current working copy and `def` is the commit you want to checkout. You can leave your harness behind (`jj new def`), do whatever you need there, then come back (`jj edit abc`). You can also bring your harness with you with `jj rebase -s @ -o def`. If it's something you commonly use, you can create a change for it and keep it as a parent, and then use a filter to prevent changes starting with a prefix (let's say local:) from being pushed. That said, there are some rough edges about keeping changes as a parent IMO (like having to set up command aliases or keep having to move it, depending on your workflow).
[0] https://steveklabnik.github.io/jujutsu-tutorial/real-world-w...
It was not complicated with git either. If there was some important change that I didn't want to commit yet, I stash it. Same with experiments that contained valuable information. Then I can use stash apply whenever I want. Never had trouble jumping around the git graph.
One key thing is that I find that conflicts are a very good signal for when the intent of the worktree at commit c clashes with the intent of patch p. Especially if you've designed the code to follow the single responsibility principle. I don't want to sweep this under the rug. Instead I want to solve it right away.
A lot of jj advocates need to better highlight their workflows and why they think git was not doing well for them. I think there's too much focus on managing files instead of unit of changes (contained in patches).
> A lot of jj advocates need to better highlight their workflows and why they think git was not doing well for them.
Yes, I agree. Nowadays I use jj but I had the same feel before trying it, and I do think git usually works fine. What does it for me is just that it makes things simpler and there are fewer commands and special cases. I can use the same command I use to stage things and to move some changes from/to any commit (`jj squash -i`, adding `--from` and `--into` as needed). The same command I use to create a new commit is the one I use to merge (`jj new`, a merge is just a commit with more than one parent). It's super easy to change which commit a branch points to (`jj bookmark move`). With a few commands I can do most things and most of the time I just look at the single page CLI reference[0] to figure it out in a few minutes. I still use git when I need one of the (still) unsupported features, which in my case were submodules and LFS.
> If there was some important change that I didn't want to commit yet, I stash it. Same with experiments that contained valuable information. Then I can use stash apply whenever I want. Never had trouble jumping around the git graph.
Stash: for me, I just find it simpler with jj really. My "stash entries" show up in `jj log` just like everything else, and I immediately know in which parent it's based on. I can use the same commands to deal with the stash as I use for every commit, like I said in the previous paragraph, and I do not need to remember at which index the change was on the stash stack. I can also add a description to it if I want. Surely it's possible to do most of these in git, but in jj I already know how to do all of these as it's the same as any other commit.
> One key thing is that I find that conflicts are a very good signal for when [...] I don't want to sweep this under the rug. Instead I want to solve it right away.
Edit: ah, you're talking about the article. I also don't like leaving conflicts open and I do not use the edit workflow (where you edit commits in history directly). I will either: 1. create a new commit on top of the one I want to edit, then squash and immediately fix conflicts, or 2. work on the latest and squash all the way to the commit I want it on, then fix conflicts. TBF I don't think the way the article does it is too different from what you'd do with git, on git conflicts would only show when you do something like a rebase, a merge, maybe an amend. With the edit workflow it shows up when editing the files. At that point on git you're also "ignoring" the conflicts as you haven't merged / rebased yet.
For me the advantage on `jj`'s conflict handling is that I'll create a new commit on top of the conflicted commit, fix the conflicts there, then review while squashing my fixes (or maybe even comparing to the conflicted commit's parent, with `jj diff --from @--`, this way I can see the whole picture of the fix.
i have not used jj, but if you are introducing sqaush/new just you get what the stage does cleanly then you are implictly agreeing with the stage model.
> i have not used jj, but if you are introducing sqaush/new just you get what the stage does cleanly then you are implictly agreeing with the stage model.
Squash / new also do it cleanly, just like `git add -e` (I'm not sure what you mean with "cleanly", does it mean "as a special concept?"). And you're right, I agree with the stage model (that's most of the point of my comment!), and I personally think it works pretty well on jj.
I think that's where I disagree with you. Git introduces the staging area (and stash) as separate concepts divorced from the DAG of changes. JJ just has the DAG, and nothing else. I'd say JJ is the cleaner model.
[snapshot]
auto-track = """
root-glob:"{src,tests}/**/*.rs" |
root-glob:"Cargo.*" |
root-file:"README.md"
"""
I set it to `snapshot.auto-track = "none()"` in the global config so that it is turned off by default and then selectively adjust it for a project.You can also leave it as `none()` and then manually add files as before.
Note also that this has nothing to do with the staging area, but with selecting which files to add to a repo, which other VCSes can do just fine without having a staging area.
In fact, selective auto-track plus not having to explicitly stage changes makes it less of a risk that you forget to add something.
I agree with that, which is why I pointed you at the auto-track setting. I also think that automatically adding everything is a poor default.
> after all software engineering is a craft, so craft you commits.
I could not disagree more. Reliability dictates that you minimize the risk of errors, including those from having unnecessary manual steps for frequently repeated operations.
My point here is especially git vs. pretty much any other VCS aside from jj, not git vs. jj; do not assume there are only two options here. Being explicit about adding files to a repo is generally a good idea. Having to repeat the process for already added files for every commit is just another opportunity for errors.
And as I wrote in another comment [1], I actually consider the staging area an anti-pattern for unrelated reasons.
`git add -e` your files as you are satisfied (of course after remove your debug harness). this way you debug harness stays put in your sandbox/worktree and no harness leaks into your project which remains pristine. this is something that .gitignore cannot do. jj cannot. you have remove all your harness, TODOs and others just to commit and then add it back again. that just means your version control failed.
and no, i am not advocating you should no add .gitignore.
No, you don't. You can split. You can untrack. You can change your auto-track configuration. There are many ways to deal with this other than having to remove them. You can be equally deliberate about what goes into your final commit.
You have a much more flexible stage in jj than in git. It's not gone anywhere. They just promoted it to first class and don't call it a stage.
> you have to either write a .gitignore counterpart for jj or manually remove them before committing.
I'll admit it is a pain. The one nice outcome, though, is that you now have everything in .gitignore and don't get "?" in your status.
> just commit and type your message when the context is fresh in your head.
The nice thing about jj is you don't need to worry about the "fresh in your head" part. You can write the commit message before you even begin, and modify it as you go along. You can commit things with no message (which I sort of use as staging), and much later, after several commits, go back and put in the message.
jj gives you the best of both worlds. If you want the friction, you can have it - with no more commands than with git. If you don't want it, fewer commands. And if you want a fancier stage you can have that too.
* Agent and I go through a whole plan for the feature
* This includes 'the commits' ahead of time for the story that I think the history should tell for the feature
* agent does the entire feature
* I review each commit one by one and we can make the fixes in place with the commits they belong to, but still have the history what needed to be changed.
* When everything is done I push to the remote.
I have been enjoying this workflow enough that I started working on a diff viewer[1] that had jj support.I wrote a jj skill (https://github.com/mhw/jj-skill) that tries to address both of those issues, and explaining some higher-level workflows like the conflict resolution example I described above. It happily goes through the conflicts creating new commits off them, resolving the conflict, and then squashing the results.
Long-term I'm sure LLMs will have JJ in their training data.
edit: there is! https://tabbyml.github.io/jj-benchmark/
Only gap that I care about is jj workspaces<->git worktrees is not fully implemented. You can now auto create a worktree when you create a workspace, but not the reverse. There's prs for this though. I hope they get merged soon.
Claude is also very good at fixing merge conflicts as well.
That said, I think JJ will get better when it's backing on to something that's designed from scratch rather than backing on to git and forges like Git(Hub|Lab) which really restrict it.
Longer version: if jj was what git had been originally, it would have saved millions of people a lot of pain and annoyance. It's definitely a better tool than git originally was. By now, though, git has gotten reasonably better, and the ecosystem around it has become polished enough, that the nicer, well-thought out UI of jj isn't as much of a slam dunk win anymore. It's still pretty good to work with, but there were enough papercuts for it to be not worth it for me: missing docs and features due to immaturity (presumably/hopefully to a lesser degree by now than back then), the friction of bookmarks interacting with branches in remote git forges, the fact that every throwaway file is committed right away (theoretically optional, practically assumed by every jj workflow out there) so you need to both ignore it and prune it out of history every time, there being `jj <command>`s and `jj git <command>`s that you need to remember which is which - all of these have understandable reasons and are small things, but overall added up to the fact that I felt myself dreading the jj-specific issues more than I enjoyed the upsides of it.
The workflow is straightforward: I create a named revision for the work I want to do, then an unnamed revision on top. I prompt Claude, changes land in the unnamed revision, I review those, squash the parts that I'm ready to accept, prompt some more to iterate on the parts that aren't up to par yet. Rinse and repeat until the topmost (unnamed) revision is empty.
I instructed Claude that I use jj with the squash workflow, so it should never touch revisions with a non-empty description (I also needed to tell it to shut up about that check), and the whole thing flows pretty damn smoothly.
I just really with they would add :q as a quit option. Vi has given me brain damage.
Totally guilty to have used AI (Claude Code) entirely to make this learning tool for me, and hopefully for others. There may be errors, please feel free to correct and point out.
jj - taken through a small repository through 24 steps, drawn in 3D. Beside each step is the same step in Git.
Git and jj work trees are not interoperable, so any tool that assumes git forces you back. Looking at you, Claude app…
Write yourself a very good JJ skill or reference file from your AGENTS.md.
My LLMs struggled with it a lot too, but I slowly covered everything they were messing up and they haven't made a mistake in months now. Even when there are "divergent" issues, it knows how to recover now.
This hasn't been an issue for me for a while now, and I've actually had Opus 5.5 and Gemini Hydrogen build and submit a 28 commit deep stack, with all the reviewing/rebasing/shifting around that entails.
That was the biggest hurdle for me too. I was a 2+ year jj user, then I had to switch back to git because of all the agentic tools relying on it.
I recently went back to jj, after finding a decent skill [1] and discovering Emacs' majutsu plugin. Claude still tries to do a git command every once in a while, but it's a lot more bearable.
I can say this hasn't always been the case, and until about 2 (maybe 3?) months ago I would handle all the VCS related parts of the work. I would let the agents write code, which I've found less and less necessary to tweak as time has gone on, and write the commit messages and create the PRs by hand.
My colleagues (who use git) let Claude write commit messages, but I find those awfully long-winded and my eyes just glaze over when I open their PRs - but to each their own I guess.
At least the Claude commit messages are an improvement over the commit messages before - I gave up trying to get them to apply the recommendations of how to write good commit messages given in https://cbea.ms/git-commit/
It works totally fine.
It's a tad opinionated: my agents are not allowed to push to external repos — but that's easy to change if you need
I mean, jj arguably serves LLMs better than git, and yet jj is not the new model we're gonna need, it is merely closer to the next model. I'm pretty sure line-based diffs will go away - structural and/or semantic merges would matter more. Writing code is now cheap and reviewing it is the bottleneck. The tools would need to clearly emphasize intent and risk, raw hunks here already feel almost useless.
But I still miss the number commit references from mercurial...
I proposed it and the team rejected saying jj solves a problem that was solved by LLMs and git, and that it would introduce paper cuts to our workflow.
JJ is much better, and I want the tooling to support it better, but it's not there yet in general.
By default it ignores jj for me and just uses git. The team wasn't eager to add more to the context.
Also I’m sure there’s a joke in here about rollbacks.