Select all my branches with the goal of rebasing them all on the trunk #4974
-
After fetching the latest |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The revset $ jj rebase -b 'all:mutable() & mine()' -d trunk() This revset was written by pelme in Discord. |
Beta Was this translation helpful? Give feedback.
-
After thinking about this problem more, I think the safer version of this is: $ jj rebase -d main -s 'all:(::main)+ & mutable()' At first, it might seem like simply rebasing # WARNING: May cause problems, see below
$ jj rebase -d main -r mutable() However, that can accidentally transplant revisions. Suppose you pushed two revisions, and someone else put a bookmark on the first:
jj's default settings would make revision B immutable because an untracked remote bookmark points to it. If you rebase
So, you probably want to rebase all mutable changes whose parent is in the main branch. The revset below will select the base of each branch off $ jj rebase -d main -s 'all:(::main)+ & mutable()' Explanation:
This does lose the |
Beta Was this translation helpful? Give feedback.
After thinking about this problem more, I think the safer version of this is:
$ jj rebase -d main -s 'all:(::main)+ & mutable()'
At first, it might seem like simply rebasing
mutable()
would work:However, that can accidentally transplant revisions. Suppose you pushed two revisions, and someone else put a bookmark on the first:
jj's default settings would make revision B immutable because an untracked remote bookmark points to it. If you rebase
-r mutable()
, revision C will be transplanted: