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
{{ message }}
Repository navigation
Rebase worktree onto new stacked base after setBaseBranch #775
#187 / #774 records ThreadInfo.baseBranch and lets the user change it after create (threads.setBaseBranch). Changing the base retargets later merge/PR. A bound worktree is retargeted onto the new start-point.
Plan
When setBaseBranch succeeds and worktreePath is set, retarget the worktree before persisting the new base.
Dirty porcelain: refuse with WORKTREE_DIRTY; recorded base and HEAD stay put.
Clean tree with unique thread-branch commits: git rebase --onto <newBase> <oldStart> so those commits stay on top of the new base.
Clean tree with no unique commits: reset onto the new start-point (or repo default when cleared).
Rebase conflict: abort + rollback; recorded base and worktree HEAD unchanged.
Still refuse after the first PR.
Do not change the Git-tab default target (origin/HEAD → main when unset).
Tests
setBaseBranch on a clean worktree with no unique commits moves HEAD to the new base.
Dirty worktree is refused and the recorded base is left unchanged.
A worktree with a unique commit keeps that commit on top of the new base (HEAD is the rebased tip, not the base tip).
Rebase conflict leaves the recorded base and worktree HEAD unchanged.
Implemented on coder/fork-fork-fork-merge-worktree-lands-on-t-248af4.
setBaseBranch now retargets a bound worktree before persisting ThreadInfo.baseBranch:
Clean tree: git reset --hard onto the new base (or repo default when cleared). HEAD moves.
Dirty tree: WORKTREE_DIRTY, recorded base left unchanged.
Git-tab Merge with no recorded base is still origin/HEAD → main. Unique commits on the thread branch are dropped (recreate, not rebase); that is a follow-up.
Activity
currentbits commentedon Aug 29, 2026
Implemented on
coder/fork-fork-fork-merge-worktree-lands-on-t-248af4.setBaseBranchnow retargets a bound worktree before persistingThreadInfo.baseBranch:git reset --hardonto the new base (or repo default when cleared). HEAD moves.WORKTREE_DIRTY, recorded base left unchanged.Git-tab Merge with no recorded base is still
origin/HEAD→main. Unique commits on the thread branch are dropped (recreate, not rebase); that is a follow-up.