4 ms·
`jj split --interactive` is built in, and will handle that exact case for you. It also comes with a built in TUI so you can select lines right from the terminal
by aseipp 2y ago
`jj split --interactive` is built in, and will handle that exact case for you. It also comes with a built in TUI so you can select lines right from the terminal immediately.
You can even do `jj split --parallel` which will not only split the changes into two commits, but then make the commits siblings (instead of child/parent), so you can immediately push things if they're easy fixes.
I have a base of B with my commit @ that contains a bunch of changes.
B --> @
`jj split` will give me this graph, where `X` contains the changes I selected, and `@` contains all the changes I didn't select:
B --> X --> @
Instead, if I did `jj split --parallel`, I would get this:
B --> @
\
--> X
Let's say `X` is a typofix and @ contains your feature you're not done with yet. OK, just run `jj git push -c X` and jj will create a branch name for you, and push it to the remote for code review. Done. You don't have to switch branches or do anything. You basically can just stop thinking about X since it will probably get merged.
- 0cf8612b2e1e 2y agoGreat visual and I will definitely have to check it out now.