Skip to content
Discussion options

You must be logged in to vote

This can probably be done using a shell script.

Given the BASE and the BRANCH containing changes, here’s some pseudo code:

  1. For each COMMIT_ID in between the fork point and the new BASE location (jj log -r "fork_point(BASE | BRANCH)..BASE" -T 'commit_id ++ "\n"' --no-graph --reversed):
    1. Rebase the commits from the branch onto the “incremental” commit: jj rebase -r "BASE..BRANCH" -o "$COMMIT_ID"
    2. Check if the rebase introduced any conflicts, by storing jj log -r "BASE..BRANCH & conflicts()" --count as a COUNT variable:
      1. If the $COUNT is 0, continue the loop.
      2. If the $COUNT is greater than 0, the rebase introduced new conflicts.
        1. Run jj undo to go back to the last non-conflicted state.
        2. Exit t…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@xobs
Comment options

Comment options

You must be logged in to vote
1 reply
@xobs
Comment options

Answer selected by xobs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants