Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates gh stack init so that when users pass explicit branch names along with --prefix, the prefix is applied to those branch names (matching the behavior users get in interactive flows), and adds a regression test to cover the new behavior.
Changes:
- Apply
--prefixto explicitly provided branch arguments duringinit. - Store the prefixed branch names in the stack file when initializing from explicit branches.
- Add a unit test verifying prefixed branch creation + persisted stack state.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/init.go | Prefix explicit branch args before branch existence checks / creation and before persisting stack branches. |
| cmd/init_test.go | Adds coverage asserting created branches and persisted stack branches include the prefix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Warning This is an internal experiment to assess Copilot's ability to auto-approve PRs. Please 👍 this comment if the assessment below is correct and 👎 if not. Feedback in #f-ccr-auto-approve is appreciated! Copilot thinks this PR is not ready to approve — see review comments for details. |
There was a problem hiding this comment.
Pull request overview
This PR updates gh stack init to handle stack prefixes more consistently by prompting/validating the prefix earlier and applying it to explicitly provided branch arguments, with added tests to cover the new behavior.
Changes:
- Prompt for
--prefixearlier in interactive init flows and validate the prefix before any branch creation. - Apply
--prefixto explicitly provided branch arguments (gh stack init --prefix X b1 b2createsX/b1,X/b2). - Add tests verifying prefix application to explicit branches and that invalid prefixes are rejected before branch creation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| cmd/init.go | Adds early interactive prefix prompting + prefix validation; applies prefix to explicit branch args before creation. |
| cmd/init_test.go | Adds coverage for prefixed explicit branches and early invalid-prefix rejection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Warning This is an internal experiment to assess Copilot's ability to auto-approve PRs. Please 👍 this comment if the assessment below is correct and 👎 if not. Feedback in #f-ccr-auto-approve is appreciated! Copilot thinks this PR is not ready to approve — see review comments for details. |
Fixes a bug that wasn't applying prefixes to the first branch in a stack if the prefix was explicitly passed in via args to init
ex:
gh stack init -p prefix suffix-> created a branch calledsuffix, notprefix/suffixas expectedUpdated the initialization logic to ensure that when a branch prefix is specified, it is properly applied to explicitly named branches during stack creation. Also added a test to verify this behavior.