News for hackers. Stuff that matters.
Re:Jujutsu Primer by skydhash on Friday November 20, 2026 @10:53AM (#50576602)
> 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`.

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).

Re:Jujutsu Primer by steveklabnik on Friday November 20, 2026 @11:59AM (#50577902)
Same as the index, the stash is also just a commit. It's not that it's impossible to do any of this in git, it's that it's more orthogonal in jj. Commits, the stash, and the index are three features in git, but a single feature in jj. This also means you can bring all of the tools to use on your psudeo-index and psuedo-stash that you use to work with commits.
Re:Jujutsu Primer by skydhash on Friday November 20, 2026 @12:25PM (#50578441)
My mental model is like this

commits: clean patches that have been integrated somehow (even as a draft version in my local repo)

index: patch in progress (very short lived as I usually add things and commit right after). It's an editing space.

stash: valuable patches in terms of knowledge, but not relevant to any current task

While they look similar, they have different purposes and so interact with different tools.

I code for one purpose (and maybe get distracted for one thing or two) then goes on to clean up the patches and write a proper message. It's not a matter of adding and rejecting hunks. I also do edit them normally. Tooling is not a problem as I spend more time on reading and editing than on tool calls.

Stashing is similar. The patches stored there are individuals, meaning I don't have to worry about dependency when I delete one. I also don't have to worry about location as there's just one stash concept.

You can also find a way to do the same operation in jj, but I want tooling centered around the concept of a patch, not the concept of commits. jj make it awkward to work with patches.

Re:Jujutsu Primer by steveklabnik on Friday November 20, 2026 @12:31PM (#50578577)
Sure, I agree with all of this. I just think jj supports doing all of this even easier than git does.