Skip to content

Select all my branches with the goal of rebasing them all on the trunk #4974

Answered by jennings
jennings asked this question in Nice Revsets
Discussion options

You must be logged in to vote

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:

# 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:

◆    M (main)
|
| ○  C (my-branch)
| |
| ◆  B (someone-else@origin)
|/
◆    A

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:

○    C' (my-branch)
|
◆    M (main)
|
| ◆  B (so…

Replies: 2 comments

Comment options

jennings
Nov 25, 2024
Collaborator Author

You must be logged in to vote
0 replies
Comment options

jennings
Mar 14, 2025
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by jennings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant