News for hackers. Stuff that matters.
Re:Jujutsu Primer by nixpulvis on Friday November 20, 2026 @02:28AM (#50571315)
I'm skeptical about the no staging area, but it seems just like a HEAD commit replaces that, which could be nice.

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.

Re:Jujutsu Primer by ozim on Friday November 20, 2026 @02:54AM (#50571488)
Have to say staging area is one feature that makes people better programmers. Especially using GUI tooling to pick hunks or discard parts you don’t want to go to a commit was always super useful for me.

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 O might be just old man screaming at the clouds or agents.

Re:Jujutsu Primer by KingMob on Friday November 20, 2026 @03:08AM (#50571600)
Think of it this way: you still have a staging area in jj, but now it's a commit instead of something unique and separate. There's zero obstacle to picking and discarding hunks with jj.
Re:Jujutsu Primer by ozim on Friday November 20, 2026 @04:00AM (#50572014)
I do that for stash, I do not use stash for me it is commit or discard.
Re:Jujutsu Primer by IshKebab on Friday November 20, 2026 @05:19AM (#50572654)
Here's my current workflow:

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?

Re:Jujutsu Primer by dieortin on Friday November 20, 2026 @05:24AM (#50572692)
You would just use jj split to break the working commit into two, choosing which parts to put in which commit
Re:Jujutsu Primer by IshKebab on Friday November 20, 2026 @02:06PM (#50580125)
Ah right so I can say "jj put this change into a new/existing commit before this one"?
Re:Jujutsu Primer by ssivark on Friday November 20, 2026 @05:38AM (#50572797)
[delayed]
Re:Jujutsu Primer by nchmy on Friday November 20, 2026 @05:44AM (#50572847)
Someone already said this, but you just use jj split. Either split the whole file or use interactive mode to split the exact lines. You could also use squash if you want to move it to an existing revision/commit.

It's vastly more efficient and ergonomic - no staging area to think about, remember, stumble over, etc.

It's all dead simple if you use jjui - don't even need to learn any jj syntax

Re:Jujutsu Primer by orbisvicis on Friday November 20, 2026 @09:21AM (#50575019)
For me:

* working tree == in progress

* staging area == finished

How do can I split modifications to a single file into multiple commits? (In git)

Re:Jujutsu Primer by ozim on Friday November 20, 2026 @12:13PM (#50578228)
You stage hunks, git add —patch which is not convenient so better to use GUI tools.
Re:Jujutsu Primer by BeetleB on Friday November 20, 2026 @10:26AM (#50576044)
> Think of it this way: you still have a staging area in jj, but now it's a commit instead of something unique and separate.

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.

Re:Jujutsu Primer by wmedrano on Friday November 20, 2026 @03:35AM (#50571822)
I think jj is pretty good at this. You can use `jj squash -i` to move hunks to parent commit or `jj split to partition hunks into separate commits.
Re:Jujutsu Primer by yjftsjthsd-h on Friday November 20, 2026 @03:42AM (#50571881)
I effectively skip staging by just doing e.g.

  git commit foo bar/
To commit my changes to foo and bar/* but not baz. Also pairs well with -p.
Re:Jujutsu Primer by throawayonthe on Friday November 20, 2026 @04:01AM (#50572020)
if anything i think jj encourages you to commit selectively by doing jj squash <options> / jj split and by enabling you to edit commits with no worry
Re:Jujutsu Primer by breppp on Friday November 20, 2026 @06:07AM (#50573042)
In jj you create a new commit for the staged parts, you can name it "wip: foobariating", and then the gui tooling allows you to move files between both commits, for me it's the equivalent of a staging area/stash that you can name
Re:Jujutsu Primer by rbehrends on Friday November 20, 2026 @06:56AM (#50573492)
To each their own, but I always saw the staging area as an anti-pattern that also needlessly complicated git's mental model.

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.

Re:Jujutsu Primer by coffeeindex on Friday November 20, 2026 @12:40PM (#50578728)
> With the staging area, you don’t even know if the commit builds if you commit selectively, and manual adding is error-prone.

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

Re:Jujutsu Primer by nixpulvis on Friday November 20, 2026 @02:13PM (#50580238)
It's the lazy and pragmatic solution for those who aren't really comfortable with git / VCS.
Re:Jujutsu Primer by silon42 on Friday November 20, 2026 @03:12AM (#50571626)
I don't mind auto commits too much, but auto adding files really doesn't work for me.

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.

Re:Jujutsu Primer by nixpulvis on Friday November 20, 2026 @03:59AM (#50572009)
Agreed, seems like we want this:

    jj config set --user snapshot.auto-track "none()"
Re:Jujutsu Primer by eloisant on Friday November 20, 2026 @03:34AM (#50571818)
Yes you can create an empty commit on the top of your branch, it works like a staging area.

Or edit the commit if you just want to make a quick fix you know you'll want to squash immediately.

Re:Jujutsu Primer by dwattttt on Friday November 20, 2026 @03:54AM (#50571973)
I have a good story around these features.

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 at the start of the 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.

Re:Jujutsu Primer by zaphirplane on Friday November 20, 2026 @06:43AM (#50573360)
[delayed]
Re:Jujutsu Primer by thek3nger on Friday November 20, 2026 @06:58AM (#50573512)
The evolog doesn’t track explicit commits. It is a list of snapshots of the codebase. JJ creates a new snapshot every time you run a command (or edit a file, depending on how you configure it).
Re:Jujutsu Primer by y1n0 on Friday November 20, 2026 @09:46AM (#50575367)
[delayed]
Re:Jujutsu Primer by BeetleB on Friday November 20, 2026 @10:28AM (#50576107)
Yes, but without having to tell it to branch off.

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.

Re:Jujutsu Primer by skydhash on Friday November 20, 2026 @10:40AM (#50576354)
> One of the nice things about jj is you don't need to name a branch.

Maybe it's due to different thinking process. But I can't think of doing a branch without knowing why I would need to do it, which also give me a quick indication of how I should name it. Everything is local anyway so I don't complicate stuff.

Re:Jujutsu Primer by steveklabnik on Friday November 20, 2026 @12:24PM (#50578409)
You see the description of changes in your log, and so that's often good enough as a name. No need to give it a second one. Here's an example from a project of mine:

    │ ○  lrvwrmqv [email protected] 2026-09-07 22:13:12 977b1ab7
    │ │  harden running image identity fixtures
    │ ○  vqmsmkup [email protected] 2026-09-07 22:13:12 bcd98591
    ├─╯  add running compiler image identity
    ◆  mxvotmyz [email protected] 2026-09-07 21:53:55 trunk e37a132e
    │  satisfy the byte recovery Clippy gate
It's nicer with color. Anyway, this is an anonymous branch, with two changes on it. "add running compiler image identity" and "harden running image identity fixtures" let me know what that branch is about, without needing to add an extra name onto the branch itself.
Re:Jujutsu Primer by skydhash on Friday November 20, 2026 @02:03PM (#50580055)
I've just replied to another comment of yours

https://news.ycombinator.com/item?id=50577902

But the relevant bit to this is the following

  I want tooling centered around the concept of a patch, not the concept of commits.
Commits for me are settled patches. I don't go around editing commits that much (and I have the tooling to make it trivial). Because for me, the patch inside has served it purpose. When I found a new purpose for it, the context has already been changed, so even when it saved me a bit of typing, I had to look at it anew.

So only the few commits around my current tasks are in flux. There's not a lot, so rebasing is very easy, even with the git cli. Same with editing a span of commits. It becomes the workspace and thus can easily be modified. Everything else is just on hold. That's why I like named branch. Because I look at it holistically instead of individual commits.

Maybe your workflow is different, and you are always doing surgical treatment to a complicated tree. But I never needed to do so. These days I'm even leaning towards a single patch for a feature or a fix. Way easier for communication.

EDIT

reply slowed down by HN moderation.

Re:Jujutsu Primer by dwattttt on Friday November 20, 2026 @02:20PM (#50580354)
Other people mentioned it, but since it was what I did; I didn't commit the day before/that morning. I didn't realise I'd need that morning's version, I only realised that after mutating it.

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.

Re:Jujutsu Primer by adamtulinius on Friday November 20, 2026 @04:16AM (#50572147)
I've used jujutsu for maybe half a year by now.

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

Re:Jujutsu Primer by wry_discontent on Friday November 20, 2026 @09:53AM (#50575486)
Jumping around has been the biggest thing to me. If I wanted to look at another branch real quick, I would've either done a worktree, another clone of the repo, or some bullshit commit like 'WIP' or something.

JJ lets you freely move through the history.

Re:Jujutsu Primer by jon-wood on Friday November 20, 2026 @06:21AM (#50573164)
As others have said, the head commit is effectively a staging area, it just contains everything that you've done which you can then split/squash/rebase as you see fit. `jj split -i` felt like magic the first time I used it.

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.

Re:Jujutsu Primer by BeetleB on Friday November 20, 2026 @10:22AM (#50575983)
> I really don't like the automatic bookmark naming thing.

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.

Re:Jujutsu Primer by nixpulvis on Friday November 20, 2026 @02:15PM (#50580265)
Yea, but it's not running the rebases that's hard, it's managing the conflicts.

Does jj have something like git rerere?

Re:Jujutsu Primer by Balinares on Friday November 20, 2026 @11:26AM (#50577202)
Then imagine having as many staging areas as you want, stacked or in parallel branches or arbitrary combinations thereof with easy mechanisms to move chunks between them. That's Jujutsu.

Git feels like running with leaden shoes by contrast.