Skip to content

feat: add parsec stack for stacked PR dependency tracking#45

Merged
erishforG merged 1 commit intodevelopfrom
feature/29
Apr 15, 2026
Merged

feat: add parsec stack for stacked PR dependency tracking#45
erishforG merged 1 commit intodevelopfrom
feature/29

Conversation

@erishforG
Copy link
Copy Markdown
Owner

Summary

  • Add --on <parent-ticket> flag to parsec start for creating dependent worktree chains
  • Add parsec stack command to display the dependency graph as a tree
  • Add parsec stack --sync to rebase the entire stack in topological order
  • Stacked worktrees automatically use the parent's branch as the PR base when shipped

Changes

  • src/worktree/lifecycle.rs: Added parent_ticket: Option<String> field to Workspace struct (backward-compatible via #[serde(default)])
  • src/worktree/manager.rs: Modified create() to accept parent_ticket param; when --on is used, the parent's branch becomes the base
  • src/cli/mod.rs: Added --on flag to Start variant, added Stack command variant with --sync flag, updated routing
  • src/cli/commands.rs: Modified start() to pass on param, added stack() and stack_sync() command handlers
  • src/output/mod.rs: Added print_stack() dispatcher
  • src/output/human.rs: Added print_stack() with tree visualization (connectors, colors)
  • src/output/json.rs: Added print_stack() JSON output
  • README.md: Added parsec stack documentation section, updated parsec start with --on option, added stacked PRs to features list
  • docs/index.html: Added Stacked PRs feature card

Test plan

  • cargo build passes with no errors
  • cargo clippy passes with no warnings
  • cargo fmt --check passes
  • Create a stack: parsec start T1, parsec start T2 --on T1, parsec start T3 --on T2
  • parsec stack shows correct tree graph
  • parsec stack --json outputs structured JSON
  • parsec stack --sync rebases children onto parents in order
  • parsec ship T2 creates PR with feature/T1 as base branch (not main)
  • Existing state files without parent_ticket deserialize correctly (serde default)

Closes #29

🤖 Generated with Claude Code

Add support for stacked/dependent PRs via `--on` flag and `parsec stack` command:

- `parsec start <ticket> --on <parent>` creates a worktree branched from
  the parent ticket's branch instead of main/master
- `parsec stack` displays the dependency graph as a tree
- `parsec stack --sync` rebases the entire chain in topological order
- `parsec ship` automatically uses the correct base branch for stacked PRs
- Added `parent_ticket` field to Workspace struct (backward-compatible via serde default)

Closes #29

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@erishforG erishforG merged commit 6a27566 into develop Apr 15, 2026
7 checks passed
@erishforG erishforG deleted the feature/29 branch April 15, 2026 08:24
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.

1 participant