Skip to content

feat(submit): add interactive PR prompts and adopt existing PRs#13

Merged
boneskull merged 6 commits intomainfrom
sync-fix
Feb 3, 2026
Merged

feat(submit): add interactive PR prompts and adopt existing PRs#13
boneskull merged 6 commits intomainfrom
sync-fix

Conversation

@boneskull
Copy link
Copy Markdown
Owner

When creating PRs, users are now prompted to confirm/edit the title and
description instead of using auto-generated values silently. The --yes
flag skips prompts for non-interactive use.

When a PR already exists for a branch (created outside gh-stack), submit
now gracefully adopts it instead of failing with HTTP 422. The existing
PR's base is updated and stack navigation comments are added.

New internal/prompt package provides reusable TTY-aware prompting utilities.

When creating PRs, users are now prompted to confirm/edit the title and
description instead of using auto-generated values silently. The --yes
flag skips prompts for non-interactive use.

When a PR already exists for a branch (created outside gh-stack), submit
now gracefully adopts it instead of failing with HTTP 422. The existing
PR's base is updated and stack navigation comments are added.

New internal/prompt package provides reusable TTY-aware prompting utilities.
Copilot AI review requested due to automatic review settings February 3, 2026 03:28
@boneskull boneskull added the enhancement New feature or request label Feb 3, 2026
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 interactive prompting for PR creation and the ability to adopt existing PRs created outside gh-stack. Users are now prompted to confirm or edit PR titles and descriptions when creating PRs, with a --yes flag to skip prompts for non-interactive use. When a PR already exists for a branch, the system gracefully adopts it instead of failing.

Changes:

  • Added new internal/prompt package with TTY-aware utilities for interactive input (Input, Confirm, EditInEditor, Select)
  • Modified submit command to prompt users for PR title/body with --yes flag to skip prompts
  • Implemented PR adoption flow that detects existing PRs and integrates them into the stack

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.

File Description
internal/prompt/prompt.go New package providing TTY-aware prompting utilities with IsInteractive check and functions for input, confirmation, editor, and selection
cmd/submit.go Added --yes flag, promptForPRDetails function, adoptExistingPR function, and modified createPRForBranch to handle existing PRs
internal/github/github.go Updated CreateSubmitPR signature to accept title parameter; removed internal title generation logic
internal/github/github_test.go Updated tests to match new CreateSubmitPR signature with title parameter

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

- Add IsContentMerged() to detect when branch content is in trunk via
  squash merge (git diff --quiet comparison)
- Add interactive prompts for merged branches: delete, orphan, or skip
- Handle edge case where user is on the merged branch by checking out
  trunk first
- Change 'mark as ready for review' prompt to default to yes
- Update README to reflect actual Go 1.25+ requirement from go.mod
Show actionable guidance when submit or cascade is run on an
untracked branch, suggesting the 'gh stack adopt' command with
examples.
The com.apple.provenance extended attribute causes the binary to hang
when run as a gh extension. Clear all extended attributes after copying.
When a branch's parent exists locally but not on the remote, sync now
detects this and prompts to retarget to trunk. This handles cases where
a parent branch was deleted without merging, or never pushed.

- Add RemoteBranchExists() to check if branch exists on origin
- Add detection in sync after merged branch handling
- Add unit test for RemoteBranchExists
Copilot AI review requested due to automatic review settings February 3, 2026 04:52
@boneskull
Copy link
Copy Markdown
Owner Author

Stack


Managed by gh-stack

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 10 out of 10 changed files in this pull request and generated 3 comments.


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

- Improve --yes flag help text to clarify it affects PR creation
- Unify adopted PR message format with created PR format
- Fix warning capitalization consistency (Warning: not warning:)
- Add --yes hint in PR creation prompt
- Validate PR title is not empty
- Trim trailing whitespace in EditInEditor
- Add bounds validation for Select defaultIndex
@boneskull boneskull merged commit 2c9ae3f into main Feb 3, 2026
5 checks passed
@boneskull boneskull deleted the sync-fix branch February 3, 2026 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants