3 ms·
For me, it's two things: 1. I understood git better after ten minutes of jj than after fifteen years of git. Git just doesn't expose its underlying data model
by stavros 1y ago
For me, it's two things:
1. I understood git better after ten minutes of jj than after fifteen years of git. Git just doesn't expose its underlying data model as well as jj does. I guess, if you already know git well, this isn't going to make a difference for you.
2. This question is a bit like asking what can I do with a calculator that I can't do with pen and paper? Technically, nothing, but everything will be so much easier that you'll be much more likely to use it. Even though I can, technically, stash my worktree and jump to another commit with git, it's so fiddly to unstash (especially with multiple stacked switches/stashes) that I just never did it.
With jj, I leave commits in the middle and jump to other commits (to fix a bug or make a small change I noticed I need while working on a larger change) all the time, because there's zero friction.
jj just removes all the friction that's prevalent in git. Things are easy in jj that in git are merely possible.
- BeetleB 1y ago> With jj, I leave commits in the middle and jump to other commits (to fix a bug or make a small change I noticed I need while working on a larger change) all the time, because there's zero friction. For git users who are wondering "What friction? I just git stash and jump to another branch": In jj, you just jump without needing to type any command like git stash.
- socalgal2 1y agogit stash is not that simple. you'd need to remember what branch that stash applies to to get back to where you were. I'm new to jj. I'm still mixed on if I like it not. I think it's mostly familiarity. For example, switching to a commit puts things in the state before the files were committed. All my projects have a presumit step that says "hey! commit your files!" so they are all incompatible with jj at the moment or at leas the default. I end up having to do temp stuff like `jj new` (ok, now they're committed). Now run my presubmit scripts. Then `jj undo` so I don't have this unneeded commit. That said, I'm sure there's a better way, I just haven't gotten used jj yet. Others have said this, `jj undo` and `jj op restore` have been lifesavers though. No matter what I do I can get back to where I was before I messed up.
- skydhash 1y ago> git stash is not that simple. you'd need to remember what branch that stash applies to to get back to where you were. I use the stash for changes I like or for small experiments, not tied to anything. For any other changes, I just create a wip commit and switch. It’s trivial to switch back and soft reset.
- steveklabnik 1y agoThis is easy in jj too, I’ll often try something, jj new @- to try something else, and jj abandon whichever version I don’t end up using. The nice thing is that all of this is part of the commit graph, not buried in stashes hidden from sight.
- MangoToupe 1y ago> git stash is not that simple. It's a stack of diffs. Anyway, I've probably used this to transfer changes between branches thousands of times. Once you grasp the underlying data model all these abstractions introduced by jujutsu seem more confusing. That said, I do understand most people aren't going to take the day or so to read through any of the hundreds of detailed "explain the data model" articles online.
- socalgal2 1y agoYes I know git stash is a stack of diffs. I’m responding to this >> With jj, I leave commits in the middle and jump to other commits (to fix a bug or make a small change I noticed I need while working on a larger change) all the time, because there's zero friction. > For git users who are wondering "What friction? I just git stash and jump to another branch" git stash is not equivalent to jumping to another commit in jj
- BeetleB 1y ago> Anyway, I've probably used this to transfer changes between branches thousands of times. You could just use cherry pick.
- KingMob 1y agoI've taken to summing it up as "jj makes everyone the git guru".