You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, I'm loving to work with jj, my team less so because now lots of PRs are rebased and github doesn't play nicely with that (you can't easily review the diff between your last review and current state, ie incremental reviews and branch changes).
One of the problems I face is accidentally editing the revision at the tip of a branch in review, so what I'd like to have is a way of splitting changes in that revision (even better is the entire branch) into a new revision such that when I jj git push the branch moves forward only.
In the image above we can see that pl has changes the remote doesn't. What I'd want is to move all extra changes to nx (or a new revision, it doesn't matter) and restore pl to what the remote has.
In this case I ended up rebasing pl into the remote tip jj rebase -s pl -d 949d996b, squashing the local pl into nx (jj squash --from 0ddfd3ba --into nx) and fixing all the conflicts, which was easy because there were only a few changes, but that's not always the case.
Aside, I'd also love if there was a way to always ask for confirmation before moving a branch sideways when pushing as a safety check.
Thanks! Awesome work btw!
The text was updated successfully, but these errors were encountered:
felipemoran
changed the title
FR: Split based on remote tip to prevent rebasing branches in review
FR: Split based on remote tip to prevent force-pushing branches in review
Mar 5, 2025
I'm not sure if you're already aware of this or if it would be helpful, but if you want to prevent accidentally rewriting commits in a bookmark, you could add the bookmark to immutable_heads() to make the commits immutable. If you want to rewrite the commits sometimes though, this may not be ideal.
Hi all, I'm loving to work with
jj
, my team less so because now lots of PRs are rebased and github doesn't play nicely with that (you can't easily review the diff between your last review and current state, ie incremental reviews and branch changes).One of the problems I face is accidentally editing the revision at the tip of a branch in review, so what I'd like to have is a way of splitting changes in that revision (even better is the entire branch) into a new revision such that when I
jj git push
the branch moves forward only.In the image above we can see that
pl
has changes the remote doesn't. What I'd want is to move all extra changes tonx
(or a new revision, it doesn't matter) and restorepl
to what the remote has.In this case I ended up rebasing
pl
into the remote tipjj rebase -s pl -d 949d996b
, squashing the localpl
intonx
(jj squash --from 0ddfd3ba --into nx
) and fixing all the conflicts, which was easy because there were only a few changes, but that's not always the case.Aside, I'd also love if there was a way to always ask for confirmation before moving a branch sideways when pushing as a safety check.
Thanks! Awesome work btw!
The text was updated successfully, but these errors were encountered: