You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: rename cascade command to restack, keep cascade as alias
The `cascade` command is now `restack`, with `cascade` retained as a
Cobra alias for backward compatibility. All user-facing strings (help
text, output messages, error messages) and documentation updated
accordingly. The `--no-cascade` flag on `sync` is now `--no-restack`.
Internal identifiers (function names, `STACK_CASCADE_STATE`,
`OperationCascade`, etc.) are intentionally unchanged.
Co-authored-by: Cursor <cursoragent@cursor.com>
Copy file name to clipboardExpand all lines: ARCHITECTURE.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,22 +86,22 @@ When a multi-branch rebase is interrupted by a conflict, gh-stack saves the oper
86
86
|`current`| Branch where the conflict occurred |
87
87
|`pending`| Remaining branches to rebase |
88
88
|`original_head`| HEAD before the operation started (for abort) |
89
-
|`operation`|`"cascade"` or `"submit"`|
89
+
|`operation`|`"cascade"` or `"submit"`(`"cascade"` is used by the `restack` command)|
90
90
|`stash_ref`| Commit hash of auto-stashed uncommitted changes |
91
91
|`branches`| Full branch list (submit only; used to rebuild the set for push/PR phases) |
92
92
|`update_only`, `web`, `push_only`| Submit-specific flags preserved across continue |
93
93
94
94
### Cascade State Lifecycle
95
95
96
-
1.**Created** when a rebase conflict interrupts `cascade`, `submit`, or `sync`.
96
+
1.**Created** when a rebase conflict interrupts `restack`, `submit`, or `sync`.
97
97
2.**Removed** before `continue` resumes (will be recreated if another conflict occurs).
98
98
3.**Removed** on successful completion or `abort`.
99
99
100
100
### Cascade State Trade-offs
101
101
102
102
This is an ephemeral, single-operation state file. It is not designed to survive beyond the operation that created it.
103
103
104
-
-**Single-operation scope.** Only one cascade/submit/sync can be in progress at a time. The code checks for this file and refuses to start a new operation if one exists.
104
+
-**Single-operation scope.** Only one restack/submit/sync can be in progress at a time. The code checks for this file and refuses to start a new operation if one exists.
105
105
-**Best-effort persistence.** Save errors are ignored (`//nolint:errcheck`) because if we can't save state, the user can still recover manually by aborting the rebase and re-running the command.
106
106
107
107
## Undo Snapshots
@@ -116,7 +116,7 @@ Before any destructive operation, gh-stack captures a snapshot of every affected
116
116
{
117
117
"timestamp": "2026-02-05T12:00:00Z",
118
118
"operation": "cascade",
119
-
"command": "gh stack cascade",
119
+
"command": "gh stack restack",
120
120
"original_head": "abc123...",
121
121
"stash_ref": "",
122
122
"branches": {
@@ -133,7 +133,7 @@ Before any destructive operation, gh-stack captures a snapshot of every affected
133
133
134
134
### Snapshot Lifecycle
135
135
136
-
1.**Created** before destructive operations (`cascade`, `submit`, `sync`).
136
+
1.**Created** before destructive operations (`restack`, `submit`, `sync`).
137
137
2.**Used** by `undo`, which restores branch refs and config keys from the snapshot.
138
138
3.**Archived** to `done/` after a successful undo.
139
139
4.**Pruned** automatically: max 50 active snapshots and 50 archived. Oldest are removed first.
Copy file name to clipboardExpand all lines: README.md
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,26 +76,26 @@ main
76
76
Say we've made changes in `feature-auth`. To keep the stack in sync, we will need to rebase `feature-auth-tests` onto `feature-auth`. From branch `feature-auth`, execute:
77
77
78
78
```bash
79
-
gh stack cascade
79
+
gh stack restack
80
80
```
81
81
82
-
If you run into conflicts, resolve them and run `gh stack continue` to resume the cascade (or `gh stack abort` to cancel). Once complete, your local stacks will be in sync. _They won't yet be pushed to the remote repository._
82
+
If you run into conflicts, resolve them and run `gh stack continue` to resume the restack (or `gh stack abort` to cancel). Once complete, your local stacks will be in sync. _They won't yet be pushed to the remote repository._
83
83
84
84
#### Scenario 2: Changes in the local trunk
85
85
86
86
Maybe we pulled down `main` and it has new commits. We'll use the same strategy as above, but this time from the `main` branch:
87
87
88
88
```bash
89
-
gh stack cascade
89
+
gh stack restack
90
90
```
91
91
92
92
> [!NOTE]
93
93
>
94
-
> Since `main` (the trunk) is the parent of every stack, `gh stack cascade` will naturally cascade_all_ stacks.
94
+
> Since `main` (the trunk) is the parent of every stack, `gh stack restack` will naturally restack_all_ stacks.
95
95
96
96
#### Scenario 3: Upstream changes
97
97
98
-
Say `feature-auth` has been merged into the remote `main`. We now need to cascade the changes, but also retarget `feature-auth-tests` to `main` from `feature-auth`. You'll want to run:
98
+
Say `feature-auth` has been merged into the remote `main`. We now need to restack the changes, but also retarget `feature-auth-tests` to `main` from `feature-auth`. You'll want to run:
99
99
100
100
```bash
101
101
gh stack sync
@@ -108,7 +108,7 @@ This will:
108
108
3. Detect merged PRs
109
109
4. Clean up merged branches
110
110
5. Retarget orphaned children to trunk
111
-
6.Cascade all branches
111
+
6.Restack all branches
112
112
113
113
What it _won't_ do is push back up to the remote; see the [next section](#creating--updating-prs) for that.
114
114
@@ -124,7 +124,7 @@ Whenever you need to push these branches again, or update the PRs, you can run `
124
124
125
125
> [!TIP]
126
126
>
127
-
> `gh stack submit` does everything `gh stack cascade` does, and then some. Generally, if you want to make local mid-stack changes _without_ pushing to the remote, you'll want `gh stack cascade`; otherwise just use `gh stack submit`.
127
+
> `gh stack submit` does everything `gh stack restack` does, and then some. Generally, if you want to make local mid-stack changes _without_ pushing to the remote, you'll want `gh stack restack`; otherwise just use `gh stack submit`.
128
128
129
129
## Commands
130
130
@@ -137,11 +137,11 @@ Whenever you need to push these branches again, or update the PRs, you can run `
137
137
|`orphan`| Stop tracking a branch |
138
138
|`link`| Associate PR number with branch |
139
139
|`unlink`| Remove PR association |
140
-
|`submit`|Cascade, push, and create/update PRs in one command |
141
-
|`cascade`| Rebase branch and descendants onto parents |
140
+
|`submit`|Restack, push, and create/update PRs in one command |
141
+
|`restack`| Rebase branch and descendants onto parents |
142
142
|`continue`| Resume operation after conflict resolution |
143
143
|`abort`| Cancel in-progress operation |
144
-
|`sync`| Full sync: fetch, cleanup merged PRs, cascade all |
144
+
|`sync`| Full sync: fetch, cleanup merged PRs, restack all |
145
145
|`undo`| Undo the last destructive operation |
146
146
147
147
## Command Reference
@@ -254,11 +254,11 @@ The PR itself is not affected; this only removes the local tracking.
254
254
255
255
### submit
256
256
257
-
Cascade, push, and create/update PRs for current branch and descendants.
257
+
Restack, push, and create/update PRs for current branch and descendants.
258
258
259
259
This is the primary workflow command. It performs three phases:
260
260
261
-
1.**Cascade**: Rebase current branch and descendants onto their parents
261
+
1.**Restack**: Rebase current branch and descendants onto their parents
262
262
2.**Push**: Force-push all affected branches (using `--force-with-lease`)
263
263
3.**PR**: Create PRs for branches without them; update PR bases for existing PRs
264
264
@@ -273,51 +273,51 @@ If a rebase conflict occurs, resolve it and run `gh stack continue`.
273
273
|`--dry-run`| Show what would happen without doing it |
274
274
|`--current-only`| Only submit the current branch, not descendants |
275
275
|`--update-only`| Only update existing PRs, don't create new ones |
276
-
|`--push-only`| Skip PR creation/update, only cascade and push |
276
+
|`--push-only`| Skip PR creation/update, only restack and push |
277
277
278
-
### cascade
278
+
### restack
279
279
280
-
Rebase the current branch and its descendants onto their parents.
280
+
Rebase the current branch and its descendants onto their parents. Aliased as `cascade`.
281
281
282
282
Use this when you've made local changes and want to keep your stack in sync without pushing or creating PRs. For a full submit workflow, use `gh stack submit` instead.
283
283
284
284
If a rebase conflict occurs, resolve it and run `gh stack continue`.
|`--only`| Only restack current branch, not descendants|
291
+
|`--dry-run`| Show what would be done |
292
292
293
293
### continue
294
294
295
-
Continue a cascade or submit operation after resolving rebase conflicts.
295
+
Continue a restack or submit operation after resolving rebase conflicts.
296
296
297
297
After resolving conflicts and staging the changes, run this command to resume the operation.
298
298
299
299
### abort
300
300
301
-
Abort a cascade or submit operation in progress.
301
+
Abort a restack or submit operation in progress.
302
302
303
303
This aborts any in-progress rebase and cleans up the operation state. Your branches will be left in their pre-operation state.
304
304
305
305
### sync
306
306
307
-
Full sync: fetch from origin, detect merged PRs, clean up merged branches, retarget orphaned children, and cascade all branches.
307
+
Full sync: fetch from origin, detect merged PRs, clean up merged branches, retarget orphaned children, and restack all branches.
308
308
309
309
This is the command to run when upstream changes have occurred (e.g., a PR in your stack was merged). It handles the bookkeeping of updating your local stack to match remote state.
310
310
311
311
#### sync Flags
312
312
313
313
| Flag | Description |
314
314
| -------------- | ----------------------- |
315
-
|`--no-cascade`| Skip cascading branches |
315
+
|`--no-restack`| Skip restacking branches |
316
316
|`--dry-run`| Show what would be done |
317
317
318
318
### undo
319
319
320
-
Undo the last destructive operation (cascade, submit, or sync) by restoring branches to their pre-operation state.
320
+
Undo the last destructive operation (restack, submit, or sync) by restoring branches to their pre-operation state.
321
321
322
322
Before any destructive operation, gh-stack automatically captures a snapshot of affected branches. If something goes wrong or you change your mind, `undo` restores:
0 commit comments