← Back to context

Comment by dcre

9 hours ago

A few advantages for me, even for the same 5 commands I use over and over:

- undo

- shuffling commits around with squash, split, and rebase is much better than git’s interactive rebase

- make commits without having to come up with a branch name (I might make three versions of the same change in parallel to see how they compare)

I see git is working on adding some of this under the history command. The revset language is really not esoteric: @ is head, @—- is two behind head. That’s about it.

Part of it is that the sorts of shuffling I used to avoid because they were a pain in git (so I didn’t feel I needed them improved) are so easy in jj that I do them all the time.

> - shuffling commits around with squash, split, and rebase is much better than git’s interactive rebase

Can you explain this to me? I feel like Git is pretty easy there.

    - select oldest commit to modify
    - move the commits around with a mouse or the cursor
    - close the editor to apply

Sure, the first step can go away (which is what they do with git history), but the rest seems pretty optimal to me.

Alternatively I can add changes to older commits by recording them on top (--fixup) and tell git to auto apply them (--autosquash). I can also tell git to do the first thing automatically (git absorb, I believe it's inspired by jj).