Skip to content

Commit 4604b79

Browse files
committed
rm unstack
1 parent d4967d8 commit 4604b79

10 files changed

Lines changed: 4 additions & 275 deletions

File tree

README.md

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -326,37 +326,6 @@ gh stack view --short
326326
gh stack view --json
327327
```
328328

329-
### `gh stack unstack`
330-
331-
Remove a stack from local tracking and optionally delete it on GitHub.
332-
333-
```
334-
gh stack unstack [branch] [flags]
335-
```
336-
337-
If no branch is specified, uses the current branch to find the stack. By default, the stack is removed from both local tracking and GitHub. Use `--local` to only remove the local tracking entry.
338-
339-
| Flag | Description |
340-
|------|-------------|
341-
| `--local` | Only delete the stack locally (keep it on GitHub) |
342-
343-
| Argument | Description |
344-
|----------|-------------|
345-
| `[branch]` | A branch in the stack to delete (defaults to the current branch) |
346-
347-
**Examples:**
348-
349-
```sh
350-
# Remove the stack from local tracking and GitHub
351-
gh stack unstack
352-
353-
# Only remove local tracking
354-
gh stack unstack --local
355-
356-
# Specify a branch to identify the stack
357-
gh stack unstack feature-auth
358-
```
359-
360329
### `gh stack merge`
361330

362331
Merge a stack of PRs.

cmd/root.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ func RootCmd() *cobra.Command {
3535
root.AddCommand(PushCmd(cfg))
3636
root.AddCommand(SubmitCmd(cfg))
3737
root.AddCommand(SyncCmd(cfg))
38-
root.AddCommand(UnstackCmd(cfg))
3938
root.AddCommand(MergeCmd(cfg))
4039

4140
// Helper commands

cmd/root_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
func TestRootCmd_SubcommandRegistration(t *testing.T) {
1010
root := RootCmd()
11-
expected := []string{"init", "add", "checkout", "push", "sync", "unstack", "merge", "view", "rebase", "up", "down", "top", "bottom", "alias", "feedback"}
11+
expected := []string{"init", "add", "checkout", "push", "sync", "merge", "view", "rebase", "up", "down", "top", "bottom", "alias", "feedback"}
1212

1313
registered := make(map[string]bool)
1414
for _, cmd := range root.Commands() {

cmd/unstack.go

Lines changed: 0 additions & 72 deletions
This file was deleted.

cmd/unstack_test.go

Lines changed: 0 additions & 118 deletions
This file was deleted.

internal/github/client_interface.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ type ClientOps interface {
1010
CreatePR(base, head, title, body string, draft bool) (*PullRequest, error)
1111
CreateStack(prNumbers []int) (int, error)
1212
UpdateStack(stackID string, prNumbers []int) error
13-
DeleteStack() error
1413
}
1514

1615
// Compile-time check that Client satisfies ClientOps.

internal/github/github.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,6 @@ func (c *Client) FindPRDetailsForBranch(branch string) (*PRDetails, error) {
266266
}, nil
267267
}
268268

269-
// DeleteStack deletes a stack on GitHub.
270-
// TODO: Implement once the stack API is available.
271-
func (c *Client) DeleteStack() error {
272-
return fmt.Errorf("deleting a stack on GitHub is not yet supported by the API")
273-
}
274-
275269
// CreateStack creates a stack on GitHub from an ordered list of PR numbers.
276270
// The PR numbers must be ordered from bottom to top of the stack and must
277271
// form a valid base-to-head chain. Returns the server-assigned stack ID.

internal/github/mock_client.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package github
22

3-
import "fmt"
4-
53
// MockClient is a test double for GitHub API operations.
64
// Each field is an optional function that, when set, handles the corresponding
75
// ClientOps method call. When nil, a reasonable default is returned.
@@ -12,7 +10,6 @@ type MockClient struct {
1210
CreatePRFn func(string, string, string, string, bool) (*PullRequest, error)
1311
CreateStackFn func([]int) (int, error)
1412
UpdateStackFn func(string, []int) error
15-
DeleteStackFn func() error
1613
}
1714

1815
// Compile-time check that MockClient satisfies ClientOps.
@@ -46,13 +43,6 @@ func (m *MockClient) CreatePR(base, head, title, body string, draft bool) (*Pull
4643
return nil, nil
4744
}
4845

49-
func (m *MockClient) DeleteStack() error {
50-
if m.DeleteStackFn != nil {
51-
return m.DeleteStackFn()
52-
}
53-
return fmt.Errorf("deleting a stack on GitHub is not yet supported by the API")
54-
}
55-
5646
func (m *MockClient) CreateStack(prNumbers []int) (int, error) {
5747
if m.CreateStackFn != nil {
5848
return m.CreateStackFn(prNumbers)

internal/stack/stack_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ func TestValidateNoDuplicateBranch(t *testing.T) {
359359
})
360360
}
361361

362-
// --- RemoveStackForBranch: used by unstack ---
362+
// --- RemoveStackForBranch ---
363363

364364
func TestRemoveStackForBranch(t *testing.T) {
365365
t.Run("found and removed", func(t *testing.T) {

skills/gh-stack/SKILL.md

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ Small, incidental fixes (e.g., fixing a typo you noticed) can go in the current
142142
| Switch to top/bottom branch | `gh stack top` / `gh stack bottom` |
143143
| Check out by PR | `gh stack checkout 42` |
144144
| Check out by branch | `gh stack checkout feature-auth` |
145-
| Remove stack | `gh stack unstack --local` |
146145

147146
---
148147

@@ -357,12 +356,6 @@ echo "$output" | jq -r '.currentBranch'
357356
echo "$output" | jq '[.branches[] | .isMerged] | all'
358357
```
359358

360-
### Clean up after all PRs are merged
361-
362-
```bash
363-
gh stack unstack --local
364-
```
365-
366359
---
367360

368361
## Commands
@@ -716,30 +709,6 @@ Resolves the target against locally tracked stacks. Accepts a PR number, PR URL,
716709
717710
---
718711

719-
### Remove a stack — `gh stack unstack`
720-
721-
Remove a stack from local tracking. Use `--local` to avoid warnings about unsupported server-side deletion.
722-
723-
```
724-
gh stack unstack [branch] [flags]
725-
```
726-
727-
```bash
728-
# Remove from local tracking
729-
gh stack unstack --local
730-
731-
# Specify a branch to identify which stack
732-
gh stack unstack feature-auth --local
733-
```
734-
735-
| Flag | Description |
736-
|------|-------------|
737-
| `--local` | Only delete the stack locally (recommended) |
738-
739-
| Argument | Description |
740-
|----------|-------------|
741-
| `[branch]` | A branch in the stack (defaults to the current branch) |
742-
743712
---
744713

745714
## Output conventions
@@ -768,6 +737,5 @@ gh stack unstack feature-auth --local
768737
2. **Stack disambiguation cannot be bypassed.** If the current branch is the trunk of multiple stacks, commands error with code 6. Check out a non-shared branch first.
769738
3. **Multiple remotes require `--remote` or config.** If more than one remote is configured, pass `--remote <name>` or set `remote.pushDefault` in git config before running `push`, `sync`, or `rebase`.
770739
4. **Merging PRs:** Merging Stacked PRs from the CLI is not supported yet. Direct users to open the PR URL in a browser to merge PRs.
771-
5. **Server-side stack deletion is not supported.** Use `unstack --local`.
772-
6. **Server-side stack discovery is not supported.** `checkout` only works with locally tracked stacks.
773-
7. **PR title and body are auto-generated.** There is no flag to set a custom PR title or body during `submit`. The title and body are generated from commit messages plus a footer. Use `gh pr edit` to modify PR title and body after creation.
740+
5. **Server-side stack discovery is not supported.** `checkout` only works with locally tracked stacks.
741+
6. **PR title and body are auto-generated.** There is no flag to set a custom PR title or body during `submit`. The title and body are generated from commit messages plus a footer. Use `gh pr edit` to modify PR title and body after creation.

0 commit comments

Comments
 (0)