News for hackers. Stuff that matters.
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.