Conversation
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.
There was a problem hiding this comment.
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/promptpackage with TTY-aware utilities for interactive input (Input, Confirm, EditInEditor, Select) - Modified
submitcommand to prompt users for PR title/body with--yesflag 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
Stack
Managed by gh-stack |
There was a problem hiding this comment.
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
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.