git-worktrees 0.12.3__tar.gz → 0.13.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/AGENTS.md +75 -21
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/CHANGELOG.md +86 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/PKG-INFO +80 -58
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/README.md +79 -57
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/completions/gw.fish +17 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/conf.d/worktrees.fish +1 -1
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/docs/DEVELOPMENT.md +1 -1
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/docs/REFERENCE.md +62 -31
- git_worktrees-0.13.1/docs/commands/add.md +85 -0
- git_worktrees-0.13.1/docs/commands/branch-create.md +49 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/docs/commands/fast-forward.md +39 -8
- git_worktrees-0.13.1/docs/commands/list.md +103 -0
- git_worktrees-0.13.1/docs/commands/merge.md +198 -0
- git_worktrees-0.13.1/docs/commands/preflight.md +121 -0
- git_worktrees-0.13.1/docs/commands/push.md +99 -0
- git_worktrees-0.13.1/docs/commands/stack-link.md +67 -0
- git_worktrees-0.13.1/functions/gwpu.fish +3 -0
- git_worktrees-0.13.1/functions/gwrk!.fish +3 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/plugin/.claude-plugin/plugin.json +1 -1
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/plugin/.codex-plugin/plugin.json +1 -1
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/plugin/README.md +21 -15
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/plugin/plugin.json +1 -1
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/plugin/skills/describe-pr/SKILL.md +5 -1
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/plugin/skills/describe-pr/format.md +6 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/plugin/skills/fast-forward/SKILL.md +25 -23
- git_worktrees-0.13.1/plugin/skills/preflight/SKILL.md +239 -0
- git_worktrees-0.13.1/plugin/skills/preflight/config.toml +6 -0
- git_worktrees-0.13.1/plugin/skills/preflight/merge_codex_rules.py +62 -0
- git_worktrees-0.13.1/plugin/skills/preflight/project.json +13 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/plugin/skills/preflight/rules.json +9 -5
- git_worktrees-0.13.1/plugin/skills/preflight/worktrees.rules +70 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/plugin/skills/ship-it/SKILL.md +107 -59
- git_worktrees-0.13.1/plugin/skills/ship-it/rights.md +89 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/pyproject.toml +1 -1
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/branch_cli.py +6 -3
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/cli.py +349 -47
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/fast_forward.py +14 -7
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/merged.py +22 -1
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/pick.py +66 -5
- git_worktrees-0.13.1/src/worktrees/pr_merge.py +729 -0
- git_worktrees-0.13.1/src/worktrees/preflight.py +256 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/prune.py +7 -16
- git_worktrees-0.13.1/src/worktrees/push.py +211 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/render.py +1 -1
- git_worktrees-0.13.1/src/worktrees/stack_link.py +159 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/worktree.py +66 -1
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/audit_schema.py +29 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/conftest.py +8 -3
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_audit.py +33 -22
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_branches.py +20 -1
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_cli.py +82 -8
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_completions.py +1 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_fast_forward.py +34 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_path_boundaries.py +4 -4
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_plugin.py +309 -25
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_pr_merge.py +376 -20
- git_worktrees-0.13.1/tests/test_preflight.py +310 -0
- git_worktrees-0.13.1/tests/test_push.py +416 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_removal.py +6 -6
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_render.py +6 -0
- git_worktrees-0.13.1/tests/test_stack_link.py +224 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_worktree.py +102 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/uv.lock +1 -1
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/completions/_gw +32 -1
- git_worktrees-0.13.1/zsh/plugins/worktrees/functions/gwpu +1 -0
- git_worktrees-0.13.1/zsh/plugins/worktrees/functions/gwrk! +1 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/worktrees.plugin.zsh +2 -2
- git_worktrees-0.12.3/docs/commands/merge.md +0 -105
- git_worktrees-0.12.3/plugin/skills/preflight/SKILL.md +0 -96
- git_worktrees-0.12.3/plugin/skills/ship-it/rights.md +0 -114
- git_worktrees-0.12.3/src/worktrees/pr_merge.py +0 -391
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/.claude/settings.json +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/.codex/config.toml +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/.github/workflows/codeql.yml +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/.github/workflows/publish.yml +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/.github/workflows/testpypi.yml +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/.github/workflows/tests.yml +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/.gitignore +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/.pre-commit-config.yaml +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/.python-version +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/.releasetools.yaml +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/LICENSE +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/Makefile +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/completions/worktrees.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/docs/BENCHMARK.md +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/docs/commands/branch-prune.md +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/docs/commands/branch-status.md +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/docs/commands/ci-checks.md +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/docs/plans/2026-11-05-worktree-pruning-design.md +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/functions/gw.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/functions/gwa.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/functions/gwbc.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/functions/gwbp.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/functions/gwbs.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/functions/gwff.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/functions/gwl.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/functions/gwm.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/functions/gwp!.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/functions/gwp.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/functions/gwpa!.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/functions/gwpa.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/functions/gwr!.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/functions/gwr.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/functions/gws.fish +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/hatch_build.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/plugin/hooks/codex.json +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/plugin/hooks/hooks.json +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/plugin/session.md +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/plugin/skills/ci-checks/SKILL.md +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/plugin/skills/preflight/agents/openai.yaml +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/plugin/skills/prune/SKILL.md +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/renovate.json +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/scripts/README.md +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/scripts/benchmark.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/scripts/bump_version.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/scripts/verify-publish.bash +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/__init__.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/audit.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/branch_forge.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/branches.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/ci.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/errors.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/forge.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/git.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/layout.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/new_branch.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/progress.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/repo.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/sync.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/src/worktrees/verdicts.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_assessment.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_benchmark.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_branch_forge.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_ci.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_command_defaults.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_fixture.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_forge.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_gates.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_git_records.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_new_branch.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_partial_clone.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_shims.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_spec.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_sync.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/tests/test_version.py +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/functions/gw +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/functions/gwa +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/functions/gwbc +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/functions/gwbp +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/functions/gwbs +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/functions/gwff +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/functions/gwl +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/functions/gwm +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/functions/gwp +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/functions/gwp! +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/functions/gwpa +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/functions/gwpa! +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/functions/gwr +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/functions/gwr! +0 -0
- {git_worktrees-0.12.3 → git_worktrees-0.13.1}/zsh/plugins/worktrees/functions/gws +0 -0
|
@@ -72,7 +72,8 @@ failed.
|
|
|
72
72
|
|
|
73
73
|
A shortcut is one call to the `gw` function with fixed words, by its plain
|
|
74
74
|
name so a shortcut to a command that lands still lands: `gwa` calls `gw add`,
|
|
75
|
-
`gwl` calls `gw list`, `gwr!` calls `gw remove --yes`,
|
|
75
|
+
`gwl` calls `gw list`, `gwr!` calls `gw remove --yes`, `gwrk!` calls
|
|
76
|
+
`gw remove --keep-branch --yes`, and
|
|
76
77
|
`gwpa!` calls `gw prune --delete all --yes`. No shortcut has a console script.
|
|
77
78
|
The `shortcuts` field of a row in `cli.py` lists that command's; `gw --help`
|
|
78
79
|
prints them under it, and `tests/test_shims.py` holds every function file in
|
|
@@ -162,10 +163,25 @@ and one that does not re-apply leaves an `autostash` entry that the result
|
|
|
162
163
|
names by sha as `stash-conflict`. The first conflict stops the rebase and
|
|
163
164
|
leaves it in progress, at exit 1 with the stopped commit and files in
|
|
164
165
|
`--json`, for a person or the agent plugin to finish with
|
|
165
|
-
`
|
|
166
|
+
`gw fast-forward --continue`, which runs `git rebase --continue` with
|
|
167
|
+
`GIT_EDITOR=true`. A branch already level exits 0. The head branch
|
|
166
168
|
only fast-forwards.
|
|
167
169
|
[fast-forward](docs/commands/fast-forward.md) gives the order of the checks.
|
|
168
170
|
|
|
171
|
+
`gw push` fetches the default remote on every run and pushes the branch
|
|
172
|
+
checked out: `--set-upstream` when the remote lacks it, otherwise
|
|
173
|
+
`--force-with-lease=refs/heads/BRANCH:SHA` on the sha the fetch read.
|
|
174
|
+
Two checks come first. `push.only_there` lists the remote copy's commits
|
|
175
|
+
that neither the branch nor the head ref holds by sha or patch-id, outside
|
|
176
|
+
the copy's own `merged.merged_part`. A merge or an empty commit has no
|
|
177
|
+
patch-id in this comparison and stays in that list without another proof.
|
|
178
|
+
Any that `push.made_here` does not find through the branch's reflog is a
|
|
179
|
+
refusal that `--replace` lifts. `merged.merged_part` of the branch itself,
|
|
180
|
+
the commits the head ref already has by the proofs `gw prune` reads, is a
|
|
181
|
+
refusal nothing lifts, and names `gw fast-forward`. `--force-if-includes` is not passed: git
|
|
182
|
+
ignores it beside an explicit lease, and the first check asks what it
|
|
183
|
+
would. [Push](docs/commands/push.md) has the outputs.
|
|
184
|
+
|
|
169
185
|
## Where shell code goes
|
|
170
186
|
|
|
171
187
|
Fisher copies `functions/`, `completions/` and `conf.d/` from the repository
|
|
@@ -230,30 +246,48 @@ assumes a plugin root or a checkout at a known path.
|
|
|
230
246
|
| `ci-checks` | `gw ci-checks --json`, `--wait` to wait without polling |
|
|
231
247
|
| `describe-pr` | checks a review's title and body against its diff, and edits them |
|
|
232
248
|
| `prune` | `gw prune --json` and `gw branch status --json`, then the removals approved |
|
|
233
|
-
| `ship-it` | commits, `fast-forward`,
|
|
234
|
-
| `preflight` | `
|
|
249
|
+
| `ship-it` | commits, `fast-forward`, `gw push`, `gh pr create`, `gw stack-link` for a stacked branch on GitHub, `describe-pr`, `ci-checks`, fixes on the branch, `gw merge` on GitHub or `glab mr merge` on GitLab, then `fast-forward` in the head branch's checkout, unassisted, for this checkout or each branch it is named; given numbers, those open reviews from `ci-checks` on |
|
|
250
|
+
| `preflight` | `gw preflight --json`, then, after asking, installs the current client's permission rules at user or project scope; project scope also writes the plugin setup in `.claude/settings.json` and `.codex/config.toml` |
|
|
235
251
|
|
|
236
252
|
`describe-pr` and `ship-it` share `describe-pr/format.md`: the
|
|
237
253
|
review's title and body are the squash commit's subject and body, so one set
|
|
238
|
-
of rules writes both.
|
|
254
|
+
of rules writes both. When the agent has the technical-writing plugin's
|
|
255
|
+
`pr-description` skill, both write the title and the body in that skill's
|
|
256
|
+
format, and `format.md` keeps what to preserve, the auto-resolution block
|
|
257
|
+
and the four ways a description is wrong. `tests/test_plugin.py` holds every skill's
|
|
239
258
|
`allowed-tools` to reads, `gw sync` and `gw branch create`: no pattern
|
|
240
259
|
covers a removal, a merge, a push, a rerun or a checkout that moves. Three
|
|
241
260
|
exceptions are each skill's job: `describe-pr` may edit a review,
|
|
242
261
|
`fast-forward` runs `gw fast-forward`, which moves a base left on a merged
|
|
243
262
|
branch and pushes the branch it levelled, and the conflict loop its own
|
|
244
263
|
test lists, and `ship-it`, invoked to publish one change or the reviews it
|
|
245
|
-
names, commits, pushes, opens and edits the review,
|
|
246
|
-
as its own test lists. None pre-approves a removal.
|
|
264
|
+
names, commits, pushes, opens, links into a stack and edits the review,
|
|
265
|
+
reruns CI and merges, as its own test lists. None pre-approves a removal.
|
|
247
266
|
|
|
248
267
|
A plugin cannot grant a skill more than the turn that invoked it in Claude
|
|
249
268
|
Code, and nothing at all in Codex, so `ship-it/rights.md` lists the rules a
|
|
250
269
|
user adds to their own client configuration, and the skill checks for them
|
|
251
|
-
before it starts.
|
|
252
|
-
|
|
270
|
+
before it starts. Claude Code's rules live in `preflight/rules.json`;
|
|
271
|
+
Codex's live in `preflight/worktrees.rules`. The preflight skill merges
|
|
272
|
+
rules into the selected client's user or project file. For Codex,
|
|
273
|
+
`merge_codex_rules.py` prints a candidate with missing literal rules
|
|
274
|
+
appended, and `codex execpolicy check` validates it before approval and
|
|
275
|
+
copying. Existing rules remain; another run appends nothing. The CLI's
|
|
276
|
+
`codex` check covers plugin configuration, so the skill checks permission
|
|
277
|
+
rules even when that check passes. It runs only
|
|
253
278
|
when called by name, in both clients, and pre-approves no write, so the copy
|
|
254
279
|
over the settings file reaches the client's own prompt. Its allow patterns match prefixes, so a test holds the
|
|
255
|
-
skill's commands to never writing `--force`, `--admin`, `--auto
|
|
256
|
-
`--delete-branch`.
|
|
280
|
+
skill's commands to never writing `--force`, `--admin`, `--auto`,
|
|
281
|
+
`--delete-branch` or `--replace`. Both clients deny direct `git rebase`,
|
|
282
|
+
`gh pr merge` and `gh stack merge` commands. Claude Code denies the forced
|
|
283
|
+
push forms in `preflight/rules.json` and `gh api` calls that name a merge;
|
|
284
|
+
Codex denies every direct `git push` and `gh api` command, regardless of
|
|
285
|
+
trailing arguments.
|
|
286
|
+
`rights.md` names the limits of prefix rules. A Claude Code deny rule
|
|
287
|
+
matches past a leading assignment, so the conflict loop
|
|
288
|
+
continues a rebase with `gw fast-forward --continue`.
|
|
289
|
+
`tests/test_preflight.py` holds `project.json` and `config.toml` to the
|
|
290
|
+
setup `preflight.py` checks for.
|
|
257
291
|
|
|
258
292
|
The prune skill reads `gw prune --json` and
|
|
259
293
|
`gw branch status --json`, preserving head/sync state and full rows for eligible, empty
|
|
@@ -323,6 +357,18 @@ Both switches use `TCSANOW`: `TCSAFLUSH` discards keys typed before the list
|
|
|
323
357
|
appears, and `TCSADRAIN` blocks on an echo queue nothing reads, which is how
|
|
324
358
|
the pty tests hang.
|
|
325
359
|
|
|
360
|
+
A `[y/N]` question goes through the same switch and `_keys` in `pick.yes`,
|
|
361
|
+
and the next key answers it with no enter: `y` is yes, and every other key
|
|
362
|
+
is no, enter and esc among them, so the capital stays the default. Cbreak
|
|
363
|
+
echoes nothing, so `yes` writes `y` or `n` after the question, and it
|
|
364
|
+
switches before writing the question, so a key pressed the moment the
|
|
365
|
+
question appears is not echoed either.
|
|
366
|
+
|
|
367
|
+
`gw branch prune`'s numbered `which?` takes several keys, so `pick.line`
|
|
368
|
+
reads them through the same switch until enter, echoing each by hand and
|
|
369
|
+
taking one back on backspace. Esc or ctrl-d cancels it, as a blank answer
|
|
370
|
+
does: the command exits 0 and deletes nothing.
|
|
371
|
+
|
|
326
372
|
The list is redrawn in place when stderr is a terminal that can move its
|
|
327
373
|
cursor: the cursor climbs over the frame drawn last and erases everything
|
|
328
374
|
under it, since the filter makes the list longer or shorter. The climb counts
|
|
@@ -459,7 +505,7 @@ through `progress.line`, which clears the spinner first.
|
|
|
459
505
|
|
|
460
506
|
Every message on stderr goes through `render.fail`, `render.warn` or
|
|
461
507
|
`render.note`, a usage error and a cancelled picker included. On a terminal
|
|
462
|
-
each leads with its symbol, `✗`,
|
|
508
|
+
each leads with its symbol, `✗`, `⚠` or `→`, and its first line makes flags
|
|
463
509
|
and quoted commands bold, paths dim and shas yellow. A path is a word that
|
|
464
510
|
starts with `/`, `~/`, `./` or `../`, taken whole, so a directory named `-x`
|
|
465
511
|
is not a flag and a uuid inside one is not a sha. A failure prints every line
|
|
@@ -483,8 +529,9 @@ when eight threads are asking at once.
|
|
|
483
529
|
`gw sync` fetches every remote with `--prune --tags --no-prune-tags`, the
|
|
484
530
|
default first, updates the default remote's HEAD and queries the forge for
|
|
485
531
|
every local branch tip on eight threads. Every other command but
|
|
486
|
-
`gw version`, `gw list`, `gw ci-checks`, `gw merge`, `gw
|
|
487
|
-
|
|
532
|
+
`gw version`, `gw list`, `gw ci-checks`, `gw merge`, `gw stack-link`,
|
|
533
|
+
`gw preflight`, `gw fast-forward`, `gw push`, help and completion runs the
|
|
534
|
+
same `sync.run` first when
|
|
488
535
|
`sync.due` says so: the default remote's refs time is null or at least
|
|
489
536
|
`WORKTREES_SYNC_TTL` seconds old, 300 by default. The forge time is not read,
|
|
490
537
|
since a forge that keeps failing would sync before every command. Without a
|
|
@@ -502,16 +549,23 @@ reaches stdout, so `cd $(gw add x)` and `jq` never see it. A TTL that is not
|
|
|
502
549
|
whole seconds is a usage error at exit 2.
|
|
503
550
|
|
|
504
551
|
`WORKTREES_OFFLINE`, when non-empty, turns sync off everywhere: nothing syncs
|
|
505
|
-
first, and `gw sync` and `gw ci-checks` refuse at exit 3. Every notice that would end
|
|
552
|
+
first, and `gw sync`, `gw push` and `gw ci-checks` refuse at exit 3. Every notice that would end
|
|
506
553
|
`Run: gw sync` goes through `sync.hint`, which leaves that off offline,
|
|
507
554
|
since it names a command that refuses there.
|
|
508
555
|
|
|
509
|
-
`gw merge` squashes one GitHub PR at a supplied head SHA
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
556
|
+
`gw merge` squashes one GitHub PR at a supplied head SHA, or several in the
|
|
557
|
+
order given at the heads it reads, building each message from the title,
|
|
558
|
+
body and `pr.trailers`. A PR in a native stack merges with every open PR
|
|
559
|
+
below it in one asynchronous call, after each of those passes the same CI
|
|
560
|
+
and merge-state checks at the head the stack reported. It waits up to ten
|
|
561
|
+
minutes, polling every five seconds, for the lowest open member to settle
|
|
562
|
+
from a merge below it: its base the stack base and its head containing the
|
|
563
|
+
latest merge. A rewritten head returns `head-moved` at exit 4 without
|
|
564
|
+
submitting. It reads fresh CI and verifies membership and containment again
|
|
565
|
+
before calling the asynchronous merge API, then polls a pending operation
|
|
566
|
+
for one minute. After a merge that leaves stack members open, it fetches and
|
|
567
|
+
moves each of their local branches that stands at the head GitHub had to
|
|
568
|
+
the rewritten copy, with a compare-and-swap `git update-ref`. `enqueued` is queued, not merged. Both clients call
|
|
515
569
|
the same command; their rules admit `gw merge` without general `gh api`
|
|
516
570
|
writes. [Merge](docs/commands/merge.md) describes the result and refusals.
|
|
517
571
|
|
|
@@ -17,6 +17,92 @@ not in here, whatever it cost to build.
|
|
|
17
17
|
A release closes with a `### Choices` section when a decision in it is worth
|
|
18
18
|
the reader's time: what was chosen, and what the alternative failed to do.
|
|
19
19
|
|
|
20
|
+
## 0.13.1 - 2026-11-21
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
`gw push` checks remote merge and empty commits before replacing a
|
|
25
|
+
remote branch. A commit that the local branch and head do not account
|
|
26
|
+
for causes a `remote-only` refusal. Review the listed commits before
|
|
27
|
+
using `--replace`.
|
|
28
|
+
|
|
29
|
+
The supplied Codex rules deny direct `git push` and `gh api` commands
|
|
30
|
+
with any trailing arguments, including tag pushes and API reads.
|
|
31
|
+
Install the updated rules from `ship-it/rights.md` and restart Codex.
|
|
32
|
+
|
|
33
|
+
In Codex, `/worktrees:preflight user` installs Worktrees permission rules
|
|
34
|
+
in the user's Codex rules directory, and `/worktrees:preflight project`
|
|
35
|
+
uses the project's `.codex/rules/worktrees.rules`. Existing rules remain
|
|
36
|
+
in place. The skill validates and shows the additions before asking to
|
|
37
|
+
install them. Restart Codex after installation.
|
|
38
|
+
|
|
39
|
+
## 0.13.0 - 2026-11-21
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
`gwrk!` runs `gw remove --keep-branch --yes`. It removes the worktree and
|
|
44
|
+
keeps its branch and stashes, so the branch needs no proof that it is
|
|
45
|
+
finished.
|
|
46
|
+
|
|
47
|
+
`gw stack-link 41 42 43` links open GitHub pull requests into a native stack,
|
|
48
|
+
bottom first: it creates the stack, or adds the pull requests above the top of
|
|
49
|
+
the stack the first ones are in, and exits 0 without changing anything when
|
|
50
|
+
they are linked already. It refuses at exit 3 a closed pull request, a base
|
|
51
|
+
that is not the branch below, or a pull request in another stack, and `--json`
|
|
52
|
+
prints the stack's number and members.
|
|
53
|
+
|
|
54
|
+
The ship-it skill opens a stacked pull request with `gh pr create` and links
|
|
55
|
+
it with `gw stack-link`, using the CLI's native stack support. Install this
|
|
56
|
+
CLI release with the plugin, and replace the `Bash(gh stack link *)`
|
|
57
|
+
permission with `Bash(gw stack-link *)`, which `/worktrees:preflight` adds; in
|
|
58
|
+
Codex, replace the `gh stack link` `prefix_rule` with the `gw stack-link` one
|
|
59
|
+
in the plugin's `rights.md`.
|
|
60
|
+
|
|
61
|
+
A `[y/N]` question takes one key and no enter: `y` is yes, and any other key,
|
|
62
|
+
enter and esc among them, is no. Esc at the question prints no escape
|
|
63
|
+
sequence.
|
|
64
|
+
|
|
65
|
+
Warnings on a terminal lead with `⚠`.
|
|
66
|
+
|
|
67
|
+
Esc at `gw branch prune`'s `which?` question cancels it: the command exits 0
|
|
68
|
+
and deletes nothing.
|
|
69
|
+
|
|
70
|
+
`gw merge` merges a native stack in one call: on a PR in a stack it merges
|
|
71
|
+
every open PR below it, once each passes its CI and merge-state checks, and
|
|
72
|
+
moves local branches above it to GitHub's rewritten copy where nothing would
|
|
73
|
+
be lost. `gw merge N1 N2 ...` merges several PRs in order, builds each message
|
|
74
|
+
from the PR's title, body and trailers, and stops at the first that does not
|
|
75
|
+
merge. JSON reports `merged`, `remaining`, `branches` and `warnings`.
|
|
76
|
+
|
|
77
|
+
`gw preflight` checks whether gw and its agent plugin are set up in the
|
|
78
|
+
repository it runs in: `gh` or `glab` signed in for the default remote, GitHub
|
|
79
|
+
squashing with each pull request's title and body, the project's
|
|
80
|
+
`.claude/settings.json` and `.codex/config.toml` enabling
|
|
81
|
+
`worktrees@mihaibojin`, and the shell plugin matching the CLI's release. Each
|
|
82
|
+
check that is not ok prints its fix, and `--json` prints every check.
|
|
83
|
+
`/worktrees:preflight project` runs it first and, after asking, writes the
|
|
84
|
+
project's plugin setup for Claude Code and, where the project has no
|
|
85
|
+
`.codex/config.toml`, for Codex.
|
|
86
|
+
|
|
87
|
+
`gw push` pushes the branch you stand on to the default remote after fetching
|
|
88
|
+
it, and the `gwpu` shortcut runs it. It refuses when the remote copy holds
|
|
89
|
+
commits the branch lacks, which `--replace` pushes over, and when the branch
|
|
90
|
+
still carries commits the head branch already merged. `gw fast-forward
|
|
91
|
+
--continue` finishes a stopped rebase without opening an editor. The agent
|
|
92
|
+
plugin pushes with `gw push`, and the rules `/worktrees:preflight` writes deny
|
|
93
|
+
`git push --force-with-lease`, `git rebase`, `gh pr merge`, `gh stack merge`
|
|
94
|
+
and `gh api` merge calls.
|
|
95
|
+
|
|
96
|
+
With the technical-writing plugin installed, describe-pr and ship-it write a
|
|
97
|
+
pull request's title and body in the format of its pr-description skill.
|
|
98
|
+
|
|
99
|
+
### Fixed
|
|
100
|
+
|
|
101
|
+
`gw add NAME` asks before starting a branch that only the remote has, and
|
|
102
|
+
starts it from the remote's copy, tracking it; `--yes` approves without
|
|
103
|
+
asking, and without a terminal it refuses. `gw add NAME BASE` refuses a `BASE`
|
|
104
|
+
that differs from the commit `NAME` already has.
|
|
105
|
+
|
|
20
106
|
## 0.12.3 - 2026-11-21
|
|
21
107
|
|
|
22
108
|
### Fixed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: git-worktrees
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.13.1
|
|
4
4
|
Summary: Git worktree commands that refuse to lose work.
|
|
5
5
|
Project-URL: Bug reports, https://github.com/MihaiBojin/worktrees/issues/new
|
|
6
6
|
Project-URL: Source, https://github.com/MihaiBojin/worktrees
|
|
@@ -40,9 +40,10 @@ gw remove fix-parser # remove one worktree and its finished branch
|
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
`gw sync` fetches every remote and asks the forge about each local branch.
|
|
43
|
-
Every other command but `gw version`, `gw
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
Every other command but `gw version`, `gw list`, `gw fast-forward`,
|
|
44
|
+
`gw push`, `gw ci-checks`, `gw merge`, `gw stack-link`, `gw preflight`, help and completion runs it first once the last
|
|
45
|
+
sync is 5 minutes old, then works from local refs and that sync's evidence.
|
|
46
|
+
`gw fast-forward` and `gw push` fetch the default remote instead. `gw ci-checks` reads a pull request's checks from
|
|
46
47
|
the forge each time it runs. With `WORKTREES_OFFLINE` set, nothing touches
|
|
47
48
|
the network. Run commands inside the repository you want assessed; other
|
|
48
49
|
repositories under the same worktree root are outside their scope.
|
|
@@ -57,11 +58,14 @@ repositories under the same worktree root are outside their scope.
|
|
|
57
58
|
| `gw remove [NAME\|PATH]` | `gwr` | remove one worktree and its finished branch |
|
|
58
59
|
| `gw branch status [NAME ...]` | `gwbs` | assess local branches without worktrees |
|
|
59
60
|
| `gw branch prune [NAME ...]` | `gwbp` | confirm and delete eligible loose branches |
|
|
60
|
-
| `gw add NAME [BASE]` | `gwa` | create
|
|
61
|
+
| `gw add NAME [BASE]` | `gwa` | create a worktree for a branch and change into it |
|
|
61
62
|
| `gw branch create NAME` | `gwbc` | start a branch from the head ref, or stack it on this branch |
|
|
62
63
|
| `gw fast-forward [NAME]` | `gwff` | rebase this branch onto the head ref, or move a merged one, and what came after its merge, to a new branch |
|
|
63
|
-
| `gw
|
|
64
|
+
| `gw push` | `gwpu` | push this branch, refusing when that would delete a commit or bring a merged one back |
|
|
65
|
+
| `gw merge NUMBER... [--match-head-commit SHA]` | | squash checked GitHub PRs, a native stack in one call, respecting merge queues |
|
|
66
|
+
| `gw stack-link NUMBER NUMBER ...` | | link open GitHub PRs into a native stack, bottom first |
|
|
64
67
|
| `gw ci-checks [NUMBER]` | | read a pull request's checks from GitHub or GitLab; `gw ci` for short |
|
|
68
|
+
| `gw preflight` | | check that the forge's CLI, GitHub's squash defaults, the agent plugin and the shell plugin are set up here |
|
|
65
69
|
| `gw version` | | print the installed version |
|
|
66
70
|
|
|
67
71
|
`gw` is the one command installed on `$PATH`, and `worktrees` is its long
|
|
@@ -104,7 +108,7 @@ the plugin's tag to the same release, as each manager below describes.
|
|
|
104
108
|
### fish
|
|
105
109
|
|
|
106
110
|
```console
|
|
107
|
-
fisher install MihaiBojin/worktrees@v0.
|
|
111
|
+
fisher install MihaiBojin/worktrees@v0.13.1
|
|
108
112
|
```
|
|
109
113
|
|
|
110
114
|
Fisher copies `functions/`, `completions/` and `conf.d/` from the repository
|
|
@@ -121,7 +125,7 @@ the untagged one holds the files.
|
|
|
121
125
|
Antidote takes a `path:` into the repository, and `branch:` takes a tag:
|
|
122
126
|
|
|
123
127
|
```
|
|
124
|
-
MihaiBojin/worktrees branch:v0.
|
|
128
|
+
MihaiBojin/worktrees branch:v0.13.1 path:zsh/plugins/worktrees # in zsh_plugins.txt
|
|
125
129
|
```
|
|
126
130
|
|
|
127
131
|
The plugin puts its own `functions/` and `completions/` on `fpath` and
|
|
@@ -196,8 +200,8 @@ its stdout stays the version alone for a script to read.
|
|
|
196
200
|
An excerpt of `gw --help`'s release lines with matching CLI and shell releases:
|
|
197
201
|
|
|
198
202
|
```console
|
|
199
|
-
worktrees 0.
|
|
200
|
-
The shell plugin here is 0.
|
|
203
|
+
worktrees 0.13.1: git worktree commands that refuse to lose work
|
|
204
|
+
The shell plugin here is 0.13.1, the same release as these commands.
|
|
201
205
|
```
|
|
202
206
|
|
|
203
207
|
A shell without the variable has no plugin loaded, or one older than the
|
|
@@ -369,6 +373,8 @@ happens to it: `delete worktree` with its path, `delete ignored` for each
|
|
|
369
373
|
ignored path, sorted by name, `delete branch` and `delete stash` with their
|
|
370
374
|
restore commands, or `keep branch` under `--keep-branch`. The question
|
|
371
375
|
counts each kind: `delete 1 worktree, 1 ignored path and 1 branch? [y/N]`.
|
|
376
|
+
One key answers it, with no enter: `y` deletes, and any other key, enter
|
|
377
|
+
and esc among them, deletes nothing.
|
|
372
378
|
Each ignored path reads as the pattern that ignores it names it, from the
|
|
373
379
|
top level, with a trailing `/` on a directory: `__pycache__` lists
|
|
374
380
|
`src/pkg/__pycache__/`, never the tracked
|
|
@@ -419,10 +425,12 @@ JSON carries it in `path` and `outcome.destination`.
|
|
|
419
425
|
| `gwpa` | `gw prune --delete all` |
|
|
420
426
|
| `gwpa!` | `gw prune --delete all --yes` |
|
|
421
427
|
| `gwr!` | `gw remove --yes` |
|
|
428
|
+
| `gwrk!` | `gw remove --keep-branch --yes` |
|
|
422
429
|
|
|
423
430
|
`gwpa` permits deleting empty branches and branch stashes, and still asks
|
|
424
|
-
at a terminal. `gwpa!` and `
|
|
425
|
-
`gwr!` grants no deletion category.
|
|
431
|
+
at a terminal. `gwpa!`, `gwr!` and `gwrk!` skip that question, as `gwp!`
|
|
432
|
+
does. `gwr!` grants no deletion category. `gwrk!` keeps the branch and its
|
|
433
|
+
stashes, so the branch needs no proof that it is finished.
|
|
426
434
|
|
|
427
435
|
## Head and synchronization
|
|
428
436
|
|
|
@@ -467,7 +475,7 @@ name or URL invalidates it. Malformed or mismatched evidence proves nothing.
|
|
|
467
475
|
A moved branch needs another sync for forge evidence; local proof still works.
|
|
468
476
|
|
|
469
477
|
Every command except `gw sync`, `gw version`, `gw list`, `gw fast-forward`,
|
|
470
|
-
help and completion syncs first when the default remote's refs have never
|
|
478
|
+
`gw push`, `gw ci-checks`, `gw merge`, `gw stack-link`, `gw preflight`, help and completion syncs first when the default remote's refs have never
|
|
471
479
|
synced or last synced 5 minutes ago or more. `WORKTREES_SYNC_TTL` sets that window in whole seconds, and `0`
|
|
472
480
|
syncs before every command. The forge time does not count, so a forge that
|
|
473
481
|
keeps failing does not make every command sync. A failed sync warns, `-q` and
|
|
@@ -475,10 +483,12 @@ keeps failing does not make every command sync. A failed sync warns, `-q` and
|
|
|
475
483
|
Without a default remote nothing syncs first. An unreachable remote costs
|
|
476
484
|
every command its fetch timeout, which `WORKTREES_OFFLINE` skips.
|
|
477
485
|
`gw fast-forward` fetches the default remote and asks the forge on every
|
|
478
|
-
run, and refuses when either fails.
|
|
486
|
+
run, and refuses when either fails. `gw push` fetches the default remote on
|
|
487
|
+
every run and refuses when that fails.
|
|
479
488
|
|
|
480
489
|
`WORKTREES_OFFLINE`, set to anything but the empty string, keeps every
|
|
481
|
-
command off the network: nothing syncs first, and `gw sync`
|
|
490
|
+
command off the network: nothing syncs first, and `gw sync` and `gw push`
|
|
491
|
+
refuse at exit 3.
|
|
482
492
|
|
|
483
493
|
Commands that read objects in a partial clone need Git 2.45.1 or newer, or a
|
|
484
494
|
patched maintenance release:
|
|
@@ -491,41 +501,22 @@ makes that branch `unknown`, with one warning that `git backfill` fetches it.
|
|
|
491
501
|
## Navigation and branches
|
|
492
502
|
|
|
493
503
|
`gw list`, `gw l` and the `gwl` shortcut offer the main checkout and this
|
|
494
|
-
repository's linked worktrees. A query
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
the
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
In the picker, typing filters the rows, digits included, and Backspace
|
|
511
|
-
removes a character. Arrow keys wrap and Enter selects. Escape clears the
|
|
512
|
-
filter, and a second Escape, or one on an empty filter, cancels, as Ctrl-D
|
|
513
|
-
does. Ctrl-C exits 130.
|
|
514
|
-
|
|
515
|
-
Without a terminal, the command prints a table of every matching worktree.
|
|
516
|
-
`--table` prints that table in a terminal too; `--json` prints metadata in the
|
|
517
|
-
`worktrees` array. Neither format selects a destination or changes directory.
|
|
518
|
-
|
|
519
|
-
A current linked worktree is shown with `*` and cannot be selected. The main
|
|
520
|
-
checkout remains a destination from inside it, so you can return from a
|
|
521
|
-
subdirectory. A worktree is selected through `gw list NAME`, so a worktree
|
|
522
|
-
named `sync` or `p` never collides with a command. The fish and zsh `gw`
|
|
523
|
-
function preserves stdout and status for metadata and changes directory for
|
|
524
|
-
terminal selections.
|
|
525
|
-
|
|
526
|
-
`gw add NAME [BASE]` creates or enters a worktree. `gw branch create NAME`
|
|
527
|
-
creates a branch from the assessed head ref without setting that head as
|
|
528
|
-
upstream.
|
|
504
|
+
repository's linked worktrees. A query narrows them by name, branch or path,
|
|
505
|
+
and one that leaves a single match changes into it without a prompt. No
|
|
506
|
+
query opens the picker. Without a terminal, or with `--table` or `--json`,
|
|
507
|
+
it prints the matches and changes nothing. `gw select-main`, `gw main`,
|
|
508
|
+
`gw m` and the `gwm` shortcut change into the worktree on the head branch.
|
|
509
|
+
[List](docs/commands/list.md) gives the matching, the picker's keys and
|
|
510
|
+
each exit code.
|
|
511
|
+
|
|
512
|
+
`gw add NAME [BASE]` creates a worktree for branch `NAME` under
|
|
513
|
+
`.worktrees/NAME/` beside the main checkout and changes into it, checking
|
|
514
|
+
the branch out when it exists. A branch only the remote has starts from the
|
|
515
|
+
remote's copy, after asking or with `--yes`. [Add](docs/commands/add.md) lists where it
|
|
516
|
+
goes and what it refuses. `gw branch create NAME` starts `NAME` in this
|
|
517
|
+
checkout from the head ref, with no upstream, or stacks it on the branch you
|
|
518
|
+
stand on when you answer yes; [branch create](docs/commands/branch-create.md)
|
|
519
|
+
has the cases.
|
|
529
520
|
|
|
530
521
|
`gw fast-forward` brings the branch you stand on level with the head ref,
|
|
531
522
|
after fetching and asking the forge in the same run. A branch with no
|
|
@@ -541,20 +532,38 @@ request still targets the merged parent, which a forge leaves there unless
|
|
|
541
532
|
the parent's branch is deleted, the run moves its base to the head branch
|
|
542
533
|
and pushes the branch under a lease; commits the parent gained after its
|
|
543
534
|
merge get a branch and a request of their own first. `--autostash` carries uncommitted changes across. A branch
|
|
544
|
-
already level exits 0 and changes nothing.
|
|
545
|
-
|
|
535
|
+
already level exits 0 and changes nothing. `gw fast-forward --continue`
|
|
536
|
+
finishes a rebase it stopped once the conflicts are staged.
|
|
537
|
+
[Fast-forward](docs/commands/fast-forward.md) gives the order of the
|
|
538
|
+
checks, the JSON and the conflict loop.
|
|
539
|
+
|
|
540
|
+
`gw push` fetches the default remote and pushes the branch you stand on,
|
|
541
|
+
with `--set-upstream` when the remote lacks it and under a lease on the
|
|
542
|
+
commit it just read otherwise. It refuses when the remote copy holds a
|
|
543
|
+
commit the branch lacks by patch-id and this clone never made, which `--replace` pushes over, and
|
|
544
|
+
when the branch still carries commits the head branch merged, which
|
|
545
|
+
`gw fast-forward` drops. A plain `git push --force-with-lease
|
|
546
|
+
--force-if-includes` lets both through when the remote tip is in the
|
|
547
|
+
branch's reflog. [Push](docs/commands/push.md) has an example of each.
|
|
546
548
|
|
|
547
549
|
## Pull request checks and merges
|
|
548
550
|
|
|
549
551
|
[`gw merge`](docs/commands/merge.md) squashes one GitHub PR at its checked
|
|
550
|
-
head SHA,
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
552
|
+
head SHA, or several in the order given at the heads whose CI it reads,
|
|
553
|
+
building each message from the PR. A PR in a native stack merges with every
|
|
554
|
+
open PR below it in one call, once each passes its checks. Every merge
|
|
555
|
+
respects the merge queue. A rewritten head returns `head-moved` at exit 4 without
|
|
556
|
+
submitting. A base left on a branch whose own PR merged is refused, and
|
|
557
|
+
`gw fast-forward` moves it. Submitted operations
|
|
554
558
|
report `merged`, `enqueued`, `pending` or `failed`. The ship-it skill in
|
|
555
559
|
Codex and Claude uses this command; both the CLI and plugin must be updated
|
|
556
560
|
to provide it.
|
|
557
561
|
|
|
562
|
+
[`gw stack-link`](docs/commands/stack-link.md) links open GitHub PRs into a
|
|
563
|
+
native stack, bottom first: it creates the stack, or adds pull requests on
|
|
564
|
+
top of the one the first ones are in. The ship-it skill opens a stacked PR
|
|
565
|
+
with `gh pr create` and links it with this command.
|
|
566
|
+
|
|
558
567
|
`gw ci-checks`, or `gw ci` for short, reads one pull request, or GitLab merge
|
|
559
568
|
request, and its checks: the current branch's, or the one `NUMBER` names. It
|
|
560
569
|
writes nothing, not even the sync cache, and never syncs first.
|
|
@@ -610,11 +619,13 @@ parseable. Passing both is a usage error.
|
|
|
610
619
|
|
|
611
620
|
| Commands | `-q` | `-v` |
|
|
612
621
|
| --- | --- | --- |
|
|
613
|
-
| `gw sync`, `gw prune`, `gw remove`, `gw branch prune`, `gw add`, `gw branch create`, `gw fast-forward` | yes | yes |
|
|
622
|
+
| `gw sync`, `gw prune`, `gw remove`, `gw branch prune`, `gw add`, `gw branch create`, `gw fast-forward`, `gw push` | yes | yes |
|
|
614
623
|
| `gw branch status` | yes | no |
|
|
615
624
|
| `gw list`, `gw select-main` | no | no |
|
|
616
625
|
| `gw ci-checks` | no | yes |
|
|
617
626
|
| `gw merge` | no | yes |
|
|
627
|
+
| `gw stack-link` | no | yes |
|
|
628
|
+
| `gw preflight` | no | yes |
|
|
618
629
|
|
|
619
630
|
Other commands retain their own flags; use `--help`. Help, version and
|
|
620
631
|
completion work without an assessment. `--only` filters assessment verdicts,
|
|
@@ -714,10 +725,21 @@ through `claude --worktree` and `codex --worktree`. A Claude Code session
|
|
|
714
725
|
keeps one worktree per repository and runs `gw add` itself only where it
|
|
715
726
|
has none yet, or when another session is working in the one it has.
|
|
716
727
|
|
|
728
|
+
Run `gw preflight` once in each repository. It says whether `gh` or `glab`
|
|
729
|
+
is signed in, whether GitHub squashes with each pull request's title and
|
|
730
|
+
body, whether the project's Claude Code and Codex settings enable the
|
|
731
|
+
plugin, and whether the shell plugin is this release.
|
|
732
|
+
`/worktrees:preflight user` installs permission rules for the current
|
|
733
|
+
client. `/worktrees:preflight project` installs those rules and the plugin
|
|
734
|
+
setup in the repository. Both show the additions and ask before writing.
|
|
735
|
+
Codex uses `.rules` files and needs a restart to load them;
|
|
736
|
+
[preflight](docs/commands/preflight.md) lists every check and target path.
|
|
737
|
+
|
|
717
738
|
## Contributing
|
|
718
739
|
|
|
719
740
|
See [DEVELOPMENT.md](docs/DEVELOPMENT.md) for checks and release commands,
|
|
720
|
-
and [REFERENCE.md](docs/REFERENCE.md) for
|
|
741
|
+
and [REFERENCE.md](docs/REFERENCE.md) for each command's page and the rules
|
|
742
|
+
the commands share.
|
|
721
743
|
|
|
722
744
|
## Licence
|
|
723
745
|
|