|
|
|
|
|
by ekipan
192 days ago
|
|
I've not tried jj yet so I can only speak to impressions, and those impressions appeal to me a lot. My understanding is that jj amends all the changes in _now_ so there's only one place where changes live: the commit graph. No index, no uncommitted worktree. Just commits. And then jj supposedly gives you a lot more freedom to move through and mutate the commit graph directly, rebasing dependent work for you automatically. So instead of having to `git add -p` several times to pick apart changes from the worktree, the worktree always goes into the graph and you can `jj split` to pick them apart after. jj split # split latest commit into two
jj edit @- # go back one
jj describe # change message
jj split # whoops, insert commit in the middle
jj edit @+ # move forward again
$EDITOR myfile # do some changes
jj st # amend the changes and show status
jj edit def # jump elsewhere in the graph
jj squash # put two commits together and auto-rebase its descendants
jj new abc # start working after latest
# etc etc
|
|
The main difference, it seems, is workflow: git's "prepare then commit" vs jj's "commit then revise".
Currently I do make use of `git add -p` just like grandparent, but I also feel a psychological burden: I will often leave like 3 or 4 separate 2-line changes in the worktree because I don't wanna bother with the ceremony right now, but my perfectionism also resists me putting a lump commit. That's jj's main appeal to me. It amends my work in, then supposedly let's me sculpt it when I'm ready with less of that ceremony.