Skip to content

feat(cmd): add submit command for unified cascade, push, and PR workflow#11

Merged
boneskull merged 4 commits intomainfrom
stack-submit
Jan 30, 2026
Merged

feat(cmd): add submit command for unified cascade, push, and PR workflow#11
boneskull merged 4 commits intomainfrom
stack-submit

Conversation

@boneskull
Copy link
Copy Markdown
Owner

Adds 'gh stack submit' which combines three phases into one command:

  1. Cascade: rebase current branch and descendants onto their parents
  2. Push: force-push all affected branches with --force-with-lease
  3. PRs: create PRs for new branches (as drafts if mid-stack), update bases for existing

Supports --dry-run, --current-only, and --update-only flags. The continue
command now handles submit operations, resuming push/PR phases after
conflict resolution.

Includes state extensions (Operation, UpdateOnly fields), CreateSubmitPR
method with auto-generated titles, comprehensive e2e tests, and README
documentation.

@boneskull
Copy link
Copy Markdown
Owner Author

boneskull commented Jan 29, 2026

Stack


Managed by gh-stack

@boneskull boneskull changed the base branch from squash-merge-handling to main January 30, 2026 04:22
@boneskull boneskull marked this pull request as ready for review January 30, 2026 04:22
Copilot AI review requested due to automatic review settings January 30, 2026 04:22
Adds 'gh stack submit' which combines three phases into one command:
1. Cascade: rebase current branch and descendants onto their parents
2. Push: force-push all affected branches with --force-with-lease
3. PRs: create PRs for new branches (as drafts if mid-stack), update bases for existing

Supports --dry-run, --current-only, and --update-only flags. The continue
command now handles submit operations, resuming push/PR phases after
conflict resolution.

Includes state extensions (Operation, UpdateOnly fields), CreateSubmitPR
method with auto-generated titles, comprehensive e2e tests, and README
documentation.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new submit command that unifies the workflow of cascading, pushing, and creating/updating PRs into a single command. It also introduces fork point tracking to enable more intelligent rebasing when parent branches have been modified.

Changes:

  • Adds gh stack submit command combining cascade, push, and PR operations
  • Implements fork point tracking to handle parent branch modifications (amendments, rebases)
  • Extends state management to support different operation types (cascade vs submit)
  • Updates continue command to resume submit operations after conflict resolution

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cmd/submit.go New submit command with three-phase workflow
cmd/continue.go Enhanced to handle submit operation resumption
cmd/cascade.go Added fork point-aware rebasing with --onto support
cmd/create.go Stores fork point when creating branches
cmd/adopt.go Stores fork point when adopting branches
cmd/orphan.go Removes fork point when orphaning branches
cmd/sync.go Uses fork points for retargeting after merges
internal/state/state.go Added Operation and UpdateOnly fields for submit
internal/github/github.go Added CreateSubmitPR with auto-generated titles
internal/git/git.go Added CommitExists and RebaseOnto functions
internal/config/config.go Added fork point storage/retrieval functions
README.md Documented new submit command and updated command table
e2e/submit_test.go Comprehensive end-to-end tests for submit
*_test.go Unit tests for new functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

When submit encounters multiple cascade conflicts, the state's Pending list
gets progressively smaller. This caused the push/PR phases to miss branches
that were cascaded before the final conflict.

Adds Branches field to CascadeState to store the complete original set of
branches being submitted. On continue, this list is used to rebuild the
full branch set for push/PR phases.

Addresses PR #11 review feedback.
The submit command now provides a unified workflow that covers the use cases
of both push and pr. Removing these commands simplifies the CLI surface area.

- Remove cmd/push.go and cmd/pr.go
- Remove e2e/push_test.go
- Update e2e/chaos_remote_test.go to use git push directly or submit --dry-run
- Update README.md to remove push and pr documentation
Copilot AI review requested due to automatic review settings January 30, 2026 04:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

When creating new PRs via submit, auto-generate the PR body from
commit messages:
- Single commit: use the commit body
- Multiple commits: format as markdown sections with headers

This restores functionality that was lost when the standalone 'pr'
command was removed.
@boneskull boneskull merged commit 5d18fad into main Jan 30, 2026
5 checks passed
@boneskull boneskull deleted the stack-submit branch January 30, 2026 05:26
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.

2 participants