←back to thread

Jujutsu for everyone

(jj-for-everyone.github.io)
434 points Bogdanp | 1 comments | | HN request time: 0.262s | source
Show context
zamalek ◴[] No.45084963[source]
I'm a through-and-through JJ convert. One papercut I have experienced a few times (though I am getting much better at avoiding) is what to do when I forget to `jj new`. Assuming that I have pushed the current bookmark to the remote, is there any way to recover a new change that is the diff against the remote? I have tried rebasing, but that leads to bookmark ambiguity instead of the solution I'm looking for.
replies(5): >>45084985 #>>45085090 #>>45085256 #>>45085704 #>>45085910 #
1. aseipp ◴[] No.45085910[source]
If I understand you correctly, then you can use `jj interdiff --from name-of-branch@remote --to name-of-branch@git` in order to recover the diff between the remote branch commit and your local version of it; you could then turn that invocation into a Git .patch file and reapply it with patch(1). This only works for one commit.

The more general solution you're looking for I guess is some kind of "split based on interdiff" or something like that. I don't believe there's any way to accomplish this in a single stroke, though.