Skip to content

fix(#126): rebase existing branches onto previous chain link in chain mode - #127

Merged
admarble merged 1 commit into
mainfrom
feature/126-chain-mode-does-not-rebase-existing-branches-o
Jan 19, 2026
Merged

admarble merged 1 commit into
mainfrom
feature/126-chain-mode-does-not-rebase-existing-branches-o

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • When using --chain mode with sequant run, existing branches are now automatically rebased onto the previous branch in the chain
  • Handles rebase conflicts gracefully by aborting and warning user
  • Adds tracking of rebased branches in the summary output

Changes

  1. Add chainMode parameter to ensureWorktree() to distinguish chain mode from regular custom base branch usage
  2. Rebase logic: When branchExists && chainMode && baseBranch, rebase the existing branch onto baseRef
  3. Conflict handling: If rebase fails due to conflicts, abort and continue with branch in original state (with warning)
  4. Tracking: Add rebased: boolean field to WorktreeInfo interface and show rebased count in summary

Test Plan

  • Build passes (npm run build)
  • All existing tests pass (439 tests)
  • Manual test: Create branches, push them, run sequant run X Y --sequential --chain and verify branches are rebased

Closes #126

🤖 Generated with Claude Code

… mode

When using --chain mode with sequant run, existing branches are now
automatically rebased onto the previous branch in the chain instead
of being used as-is.

Changes:
- Add chainMode parameter to ensureWorktree() to distinguish chain mode
- When branchExists && chainMode && baseBranch, rebase onto baseRef
- Handle rebase conflicts gracefully by aborting and warning user
- Add rebased field to WorktreeInfo interface for tracking
- Update ensureWorktreesChain() summary to show rebased count

This ensures the chain structure is maintained when branches are reused:
  feature/dashboard → #114 → #116
instead of the previous broken behavior:
  feature/dashboard → #114
  feature/dashboard → #116 (not chained)

Closes #126

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chain mode does not rebase existing branches onto previous chain link

1 participant