Skip to content

Commit 05eee5a

Browse files
committed
update docs
1 parent 9c7cc91 commit 05eee5a

5 files changed

Lines changed: 68 additions & 101 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ internal/
4141
schema.json # JSON Schema for the stack file format
4242
config/ # Config struct (I/O, colors, test overrides)
4343
testing.go # NewTestConfig(). Returns *Config + stdout/stderr pipes.
44-
branch/ # branch naming (Slugify, DateSlug, NextNumberedName)
44+
branch/ # branch naming (Slugify, DateSlug)
4545
modify/ # interactive stack modification state machine
4646
pr/ # PR template discovery
4747
tui/ # bubbletea/bubbles/lipgloss terminal UI

README.md

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,15 @@ Initialize a new stack in the current repository.
7676
gh stack init [flags] [branches...]
7777
```
7878

79-
Initializes a new stack locally. In interactive mode (no arguments), prompts for a branch name and offers to use the current branch as the first layer. If a branch name contains slashes (e.g., `feat/api`), prompts if you would like to use a prefix (e.g., `feat/`) for all branches in the stack.
79+
Initializes a new stack locally. In interactive mode (no arguments), prompts for a branch name and offers to use the current branch as the first layer.
8080

8181
When explicit branch names are given, existing branches are adopted automatically and any missing branches are created. The trunk defaults to the repository's default branch unless overridden with `--base`.
8282

83-
Use `--numbered` with `--prefix` to enable auto-incrementing numbered branch names (`prefix/01`, `prefix/02`, …). Without `--numbered`, you'll always be prompted to provide a meaningful branch name.
84-
8583
Enables `git rerere` automatically so that conflict resolutions are remembered across rebases.
8684

8785
| Flag | Description |
8886
|------|-------------|
8987
| `-b, --base <branch>` | Trunk branch for the stack (defaults to the repository's default branch) |
90-
| `-p, --prefix <string>` | Set a branch name prefix for the stack |
91-
| `-n, --numbered` | Use auto-incrementing numbered branch names (requires `--prefix`) |
9288

9389
**Examples:**
9490

@@ -104,15 +100,6 @@ gh stack init --base develop feature-auth
104100

105101
# Adopt existing branches into a stack
106102
gh stack init feature-auth feature-api
107-
108-
# Set a prefix — you'll be prompted for a branch name
109-
gh stack init -p feat
110-
# → prompts "Enter a name for the first branch (will be prefixed with feat/)"
111-
# → type "auth" → creates feat/auth
112-
113-
# Use numbered auto-incrementing branch names
114-
gh stack init -p feat --numbered
115-
# → creates feat/01 automatically
116103
```
117104

118105
### `gh stack add`
@@ -125,7 +112,7 @@ gh stack add [flags] [branch]
125112

126113
Creates a new branch at the current HEAD, adds it to the top of the stack, and checks it out. Must be run while on the topmost branch of a stack. If no branch name is given, prompts for one.
127114

128-
You can optionally stage changes and create a commit as part of the `add` flow. When `-m` is provided without an explicit branch name, the branch name is auto-generated. If the stack was created with `--numbered`, auto-generated names use numbered format (`prefix/01`, `prefix/02`); otherwise, date+slug format is used (e.g., `prefix/2025-03-24-add-login`).
115+
You can optionally stage changes and create a commit as part of the `add` flow. When `-m` is provided without an explicit branch name, the branch name is auto-generated in date+slug format (e.g., `03-24-add_login`).
129116

130117
| Flag | Description |
131118
|------|-------------|
@@ -616,42 +603,42 @@ gh stack sync
616603

617604
## Abbreviated workflow
618605

619-
If you want to minimize keystrokes, use a branch prefix with `--numbered` and the `-Am` flags to fold staging, committing, and branch creation into a single command. Branch names are auto-generated as `prefix/01`, `prefix/02`, etc.
606+
If you want to minimize keystrokes, use the `-Am` flags to fold staging, committing, and branch creation into a single command. When you don't pass a branch name, one is auto-generated from the commit message in date+slug format (e.g., `03-24-auth_middleware`).
620607

621608
When a branch has no commits yet (e.g., right after `init`), `add -Am` stages and commits directly on that branch instead of creating a new one. Once a branch has commits, `add -Am` creates a new branch, checks it out, and commits there.
622609

623610
```sh
624-
# 1. Start a stack with a prefix and numbered branches
625-
gh stack init -p feat --numbered
626-
# → creates feat/01 and checks it out
611+
# 1. Start a stack
612+
gh stack init auth
613+
# → creates auth and checks it out
627614

628615
# 2. Write code for the first layer
629616
# ... write code ...
630617

631618
# 3. Stage and commit on the current branch
632619
gh stack add -Am "Auth middleware"
633-
#feat/01 has no commits yet, so the commit lands here
620+
#auth has no commits yet, so the commit lands here
634621
# (no new branch is created)
635622

636623
# 4. Write code for the next layer
637624
# ... write code ...
638625

639626
# 5. Create the next branch and commit
640627
gh stack add -Am "API routes"
641-
#feat/01 already has commits, so a new branch feat/02 is
642-
# created, checked out, and the commit lands there
628+
#auth already has commits, so a new branch is created from the
629+
# commit message, checked out, and the commit lands there
643630

644631
# 6. Keep going
645632
# ... write code ...
646633

647634
gh stack add -Am "Frontend components"
648-
#feat/02 already has commits, creates feat/03 and commits there
635+
# → creates another branch and commits there
649636

650637
# 7. Push everything and create PRs
651638
gh stack submit
652639
```
653640

654-
Compared to the typical workflow, there's no need to name branches, run `git add`, or run `git commit` separately. Each `gh stack add -Am "..."` does it all.
641+
Compared to the typical workflow, there's no need to name branches, run `git add`, or run `git commit` separately. Each `gh stack add -Am "..."` does it all. Pass an explicit branch name any time you want to control it: `gh stack add -Am "API routes" api-routes`.
655642

656643
## Terminal theme
657644

docs/src/content/docs/guides/workflows.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,40 +39,40 @@ gh stack sync
3939

4040
## Abbreviated Workflow
4141

42-
For speed, use a branch prefix with `--numbered` and the `-Am` flags to fold staging, committing, and branch creation into a single command. Branch names are auto-generated as `prefix/01`, `prefix/02`, etc.
42+
For speed, use the `-Am` flags to fold staging, committing, and branch creation into a single command. When you don't pass a branch name, one is auto-generated from the commit message in date+slug format (e.g., `03-24-auth_middleware`).
4343

4444
```sh
4545
# Alias `gh stack` as `gs` for easier use
4646
gh stack alias
4747

48-
# 1. Start a stack with numbered branches
49-
gs init -p feat --numbered
50-
# → creates feat/01 and checks it out
48+
# 1. Start a stack
49+
gs init auth
50+
# → creates auth and checks it out
5151

5252
# 2. Write code for the first layer
5353
# ... write code ...
5454

5555
# 3. Stage and commit on the current branch
5656
gs add -Am "Auth middleware"
57-
#feat/01 has no commits yet, so the commit lands here
57+
#auth has no commits yet, so the commit lands here
5858

5959
# 4. Write code for the next layer
6060
# ... write code ...
6161

6262
# 5. Create the next branch and commit
6363
gs add -Am "API routes"
64-
#feat/01 already has commits, so feat/02 is created
64+
#auth already has commits, so a new branch is created
6565

6666
# 6. Keep going
6767
# ... write code ...
6868
gs add -Am "Frontend components"
69-
# → creates feat/03
69+
# → creates another branch
7070

7171
# 7. Push everything and create PRs
7272
gs submit
7373
```
7474

75-
Each `gs add -Am "..."` stages all files, commits, and (if the current branch already has commits) creates a new branch — no separate `git add` or `git commit` needed.
75+
Each `gs add -Am "..."` stages all files, commits, and (if the current branch already has commits) creates a new branch — no separate `git add` or `git commit` needed. Pass an explicit branch name any time you want to control it: `gs add -Am "API routes" api-routes`.
7676

7777
## Making Mid-Stack Changes
7878

docs/src/content/docs/reference/cli.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,15 @@ Initialize a new stack in the current repository.
2727
gh stack init [flags] [branches...]
2828
```
2929

30-
Initializes a new stack locally. In interactive mode (no arguments), prompts for a branch name and offers to use the current branch as the first layer. If a branch name contains slashes (e.g., `feat/api`), prompts if you would like to use a prefix (e.g., `feat/`) for all branches in the stack.
30+
Initializes a new stack locally. In interactive mode (no arguments), prompts for a branch name and offers to use the current branch as the first layer.
3131

3232
When explicit branch names are given, existing branches are adopted automatically and any missing branches are created. The trunk defaults to the repository's default branch unless overridden with `--base`.
3333

34-
Use `--numbered` with `--prefix` to enable auto-incrementing branch names (`prefix/01`, `prefix/02`, …).
35-
3634
Enables `git rerere` automatically so that conflict resolutions are remembered across rebases.
3735

3836
| Flag | Description |
3937
|------|-------------|
4038
| `-b, --base <branch>` | Trunk branch for the stack (defaults to the repository's default branch) |
41-
| `-p, --prefix <string>` | Set a branch name prefix for the stack |
42-
| `-n, --numbered` | Use auto-incrementing numbered branch names (requires `--prefix`) |
4339

4440
**Examples:**
4541

@@ -55,14 +51,6 @@ gh stack init --base develop feature-auth
5551

5652
# Adopt or create multiple branches at once
5753
gh stack init feature-auth feature-api feature-ui
58-
59-
# Set a prefix — prompts for a branch name suffix
60-
gh stack init -p feat
61-
# → type "auth" → creates feat/auth
62-
63-
# Use numbered auto-incrementing branch names
64-
gh stack init -p feat --numbered
65-
# → creates feat/01 automatically
6654
```
6755

6856
### `gh stack add`
@@ -75,7 +63,7 @@ gh stack add [flags] [branch]
7563

7664
Creates a new branch at the current HEAD, adds it to the top of the stack, and checks it out. Must be run while on the topmost branch of a stack. If no branch name is given, prompts for one.
7765

78-
You can optionally stage changes and create a commit as part of the `add` flow. When `-m` is provided without an explicit branch name, the branch name is auto-generated. If the stack was created with `--numbered`, auto-generated names use numbered format (`prefix/01`, `prefix/02`); otherwise, date+slug format is used.
66+
You can optionally stage changes and create a commit as part of the `add` flow. When `-m` is provided without an explicit branch name, the branch name is auto-generated in date+slug format (e.g., `03-24-add_login`).
7967

8068
| Flag | Description |
8169
|------|-------------|

0 commit comments

Comments
 (0)