Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new gh stack switch CLI command that interactively lets users pick and check out another branch within the current stack.
Changes:
- Introduces
gh stack switchcommand implementation and wires it into the root command. - Adds test-only selection injection (
Config.SelectFn) to allow deterministic interactive-selection tests. - Updates CLI reference docs and README to document the new command.
Show a summary per file
| File | Description |
|---|---|
| internal/config/config.go | Adds SelectFn hook to simulate interactive selection in tests. |
| cmd/switch.go | Implements the switch command with an interactive picker and checkout behavior. |
| cmd/root.go | Registers the new switch command under gh stack. |
| cmd/switch_test.go | Adds unit/integration-style tests for selection behavior, ordering, and error cases. |
| docs/src/content/docs/reference/cli.md | Documents gh stack switch usage and example output. |
| README.md | Adds switch to the command list and examples. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 3
4db03c4 to
c348c63
Compare
0b144cc to
32de12d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
gh stack switchcommandAdds a new
switchnavigation command that shows an interactive picker for switching to any branch in the current stack. Branches are displayed top-to-bottom with their position number: