| ▲ | sfink 7 hours ago | |
I'm about the same. jj is kind of perfect for that. Example: # I've finished something significant! Carve it out from the working "change" as its own commit.
# Oops, missed a piece.
# Let me look at what's left.
# Oh right, I had started working on something else. I could just leave it in the working change, but let me separate it out into its own commit even though it's unfinished, since I can always add pieces to it later.
# Wait, no, I kind of want it to come before that thing I finished up. Shoot, I messed up.
# Let me try that again, this time putting it underneath.
# Note that instead of undoing and re-selecting the parts, you could also `jj rebase -r @- -B @--` to reorder. And in practice, you'll often be doing `jj log` to see what things are and using their change ids instead of things like `@--`.# I also have some logging code I don't need anymore. Let me discard it.
# Do some more work. I have some additions to that part I thought was done.
# And some additions to that other part.
# etc.There's a lot more that you could do, but once you internalize the ideas that (1) everything is a commit, and (2) commits (and changes) can have multiple parents thus form a DAG, then almost everything else you want to do becomes an obvious application of a small handful of core commands. Note: to figure out how to use the built-in diff viewer, you'll need to hover over the menu with the mouse, but you really just need f for fold/unfold and j/k for movement, then space for toggle. | ||