git-worktrees 0.8.0__tar.gz → 0.9.0__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.8.0 → git_worktrees-0.9.0}/AGENTS.md +10 -7
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/CHANGELOG.md +36 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/Makefile +9 -13
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/PKG-INFO +10 -8
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/README.md +9 -7
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/conf.d/worktrees.fish +1 -1
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/docs/DEVELOPMENT.md +14 -6
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/docs/commands/fast-forward.md +6 -4
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/plugin/.claude-plugin/plugin.json +1 -1
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/plugin/.codex-plugin/plugin.json +1 -1
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/plugin/README.md +36 -23
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/plugin/plugin.json +1 -1
- git_worktrees-0.9.0/plugin/skills/preflight/SKILL.md +96 -0
- git_worktrees-0.9.0/plugin/skills/preflight/agents/openai.yaml +2 -0
- git_worktrees-0.9.0/plugin/skills/preflight/rules.json +27 -0
- git_worktrees-0.9.0/plugin/skills/ship-it/SKILL.md +411 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/plugin/skills/ship-it/rights.md +12 -38
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/pyproject.toml +1 -1
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/branch_forge.py +4 -3
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/forge.py +45 -12
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/conftest.py +5 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_fast_forward.py +45 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_plugin.py +95 -9
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/uv.lock +12 -11
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/worktrees.plugin.zsh +1 -1
- git_worktrees-0.8.0/plugin/skills/merge/SKILL.md +0 -193
- git_worktrees-0.8.0/plugin/skills/ship-it/SKILL.md +0 -230
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/.claude/settings.json +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/.codex/config.toml +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/.github/workflows/codeql.yml +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/.github/workflows/publish.yml +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/.github/workflows/testpypi.yml +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/.github/workflows/tests.yml +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/.gitignore +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/.pre-commit-config.yaml +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/.python-version +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/.releasetools.yaml +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/LICENSE +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/completions/gw.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/completions/worktrees.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/docs/BENCHMARK.md +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/docs/REFERENCE.md +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/docs/commands/branch-prune.md +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/docs/commands/branch-status.md +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/docs/plans/2026-11-05-worktree-pruning-design.md +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/functions/gw.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/functions/gwa.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/functions/gwbc.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/functions/gwbp.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/functions/gwbs.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/functions/gwff.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/functions/gwl.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/functions/gwm.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/functions/gwp!.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/functions/gwp.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/functions/gwpa!.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/functions/gwpa.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/functions/gwr!.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/functions/gwr.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/functions/gws.fish +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/hatch_build.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/plugin/skills/ci-checks/SKILL.md +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/plugin/skills/describe-pr/SKILL.md +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/plugin/skills/describe-pr/format.md +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/plugin/skills/fast-forward/SKILL.md +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/plugin/skills/new-branch/SKILL.md +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/plugin/skills/prune/SKILL.md +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/renovate.json +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/scripts/README.md +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/scripts/benchmark.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/scripts/bump_version.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/scripts/verify-publish.bash +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/__init__.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/branch_cli.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/branches.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/ci.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/cli.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/errors.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/fast_forward.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/git.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/layout.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/merged.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/new_branch.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/pick.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/progress.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/prune.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/render.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/repo.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/sync.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/verdicts.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/src/worktrees/worktree.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_assessment.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_benchmark.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_branch_forge.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_branches.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_ci.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_cli.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_command_defaults.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_completions.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_fixture.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_forge.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_gates.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_git_records.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_new_branch.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_partial_clone.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_path_boundaries.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_removal.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_render.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_shims.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_spec.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_sync.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_version.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/tests/test_worktree.py +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/completions/_gw +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/functions/gw +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/functions/gwa +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/functions/gwbc +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/functions/gwbp +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/functions/gwbs +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/functions/gwff +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/functions/gwl +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/functions/gwm +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/functions/gwp +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/functions/gwp! +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/functions/gwpa +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/functions/gwpa! +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/functions/gwr +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/functions/gwr! +0 -0
- {git_worktrees-0.8.0 → git_worktrees-0.9.0}/zsh/plugins/worktrees/functions/gws +0 -0
|
@@ -188,25 +188,28 @@ assumes a plugin root or a checkout at a known path.
|
|
|
188
188
|
| `fast-forward` | `gw fast-forward --autostash --json`, then each rebase conflict until the branch is level |
|
|
189
189
|
| `ci-checks` | `gw ci-checks --json`, `--wait` to wait without polling |
|
|
190
190
|
| `describe-pr` | checks a review's title and body against its diff, and edits them |
|
|
191
|
-
| `merge` | `describe-pr`, `ci-checks`, fixes on the branch, `gh pr merge`, then `fast-forward` in the head branch's checkout |
|
|
192
191
|
| `prune` | `gw prune --json` and `gw branch status --json`, then the removals approved |
|
|
193
|
-
| `ship-it` | commits, `fast-forward`, a leased or plain push, `gh pr create`, `describe-pr`, the merge
|
|
192
|
+
| `ship-it` | commits, `fast-forward`, a leased or plain push, `gh pr create`, `describe-pr`, `ci-checks`, fixes on the branch, `gh pr merge`, 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 |
|
|
193
|
+
| `preflight` | `jq` merges `preflight/rules.json` into the user's or the project's `.claude/settings.json`, after asking |
|
|
194
194
|
|
|
195
|
-
`describe-pr
|
|
195
|
+
`describe-pr` and `ship-it` share `describe-pr/format.md`: the
|
|
196
196
|
review's title and body are the squash commit's subject and body, so one set
|
|
197
197
|
of rules writes both. `tests/test_plugin.py` holds every skill's
|
|
198
198
|
`allowed-tools` to reads, `gw sync` and `gw branch create`: no pattern
|
|
199
199
|
covers a removal, a merge, a push, a rerun or a checkout that moves. Three
|
|
200
200
|
exceptions are each skill's job: `describe-pr` may edit a review,
|
|
201
201
|
`fast-forward` runs `gw fast-forward` and the conflict loop its own test
|
|
202
|
-
lists, and `ship-it`, invoked to publish one change
|
|
203
|
-
and edits the review, reruns CI and merges,
|
|
204
|
-
pre-approves a removal.
|
|
202
|
+
lists, and `ship-it`, invoked to publish one change or the reviews it
|
|
203
|
+
names, commits, pushes, opens and edits the review, reruns CI and merges,
|
|
204
|
+
as its own test lists. None pre-approves a removal.
|
|
205
205
|
|
|
206
206
|
A plugin cannot grant a skill more than the turn that invoked it in Claude
|
|
207
207
|
Code, and nothing at all in Codex, so `ship-it/rights.md` lists the rules a
|
|
208
208
|
user adds to their own client configuration, and the skill checks for them
|
|
209
|
-
before it starts.
|
|
209
|
+
before it starts. The Claude Code ones live once, in `preflight/rules.json`,
|
|
210
|
+
which `preflight` merges into the settings file the user names. It runs only
|
|
211
|
+
when called by name, in both clients, and pre-approves no write, so the copy
|
|
212
|
+
over the settings file reaches the client's own prompt. Its allow patterns match prefixes, so a test holds the
|
|
210
213
|
skill's commands to never writing `--force`, `--admin`, `--auto` or
|
|
211
214
|
`--delete-branch`.
|
|
212
215
|
|
|
@@ -17,6 +17,42 @@ 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.9.0 - 2026-11-09
|
|
21
|
+
|
|
22
|
+
### Removed
|
|
23
|
+
|
|
24
|
+
`/worktrees:merge` is removed. `/worktrees:ship-it 41 42` ships open pull
|
|
25
|
+
requests or merge requests the way it did, one at a time and a stack
|
|
26
|
+
bottom first, but unassisted: it pushes fixes and merges without asking,
|
|
27
|
+
under the rules `ship-it/rights.md` lists, which `/worktrees:preflight`
|
|
28
|
+
adds to Claude Code's settings, where the merge skill asked before each
|
|
29
|
+
push and merge.
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
The agent plugin adds `preflight`, run by name as `/worktrees:preflight user`
|
|
34
|
+
or `/worktrees:preflight project`. It adds the permission rules `ship-it`
|
|
35
|
+
needs to `~/.claude/settings.json` or the repository's
|
|
36
|
+
`.claude/settings.json`, after showing every missing line and asking. A
|
|
37
|
+
committed project file reaches every machine that clones the repository.
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
`/worktrees:ship-it` could report a pull request as queued when no merge
|
|
42
|
+
queue held it. When `gh pr merge` exits 0 and the pull request is still
|
|
43
|
+
open, it now reports it as queued only when gh warned about the merge queue
|
|
44
|
+
or auto-merge is set, and as still open otherwise.
|
|
45
|
+
|
|
46
|
+
When `/worktrees:ship-it` ships several pull requests and one of them does
|
|
47
|
+
not merge, it no longer merges a pull request stacked on that one, which
|
|
48
|
+
would have landed on its branch instead of the head branch. It reports the
|
|
49
|
+
stacked pull request as waiting.
|
|
50
|
+
|
|
51
|
+
`gw fast-forward` refused a branch nobody had pushed once the head branch
|
|
52
|
+
moved, saying the forge could not be asked which request carried its first
|
|
53
|
+
commit. It now rebases such a branch, and refuses only when the forge
|
|
54
|
+
fails for another reason.
|
|
55
|
+
|
|
20
56
|
## 0.8.0 - 2026-11-09
|
|
21
57
|
|
|
22
58
|
### Changed
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
.PHONY: install-local
|
|
1
|
+
.PHONY: install install-local
|
|
2
2
|
|
|
3
3
|
VERSION := $(shell sed -n 's/^version = "\(.*\)"$$/\1/p' pyproject.toml)
|
|
4
4
|
ZSH_PLUGINS ?= $(or $(ZDOTDIR),$(HOME))/.zsh_plugins.txt
|
|
5
5
|
|
|
6
|
-
# The working copy, in place of anything published
|
|
6
|
+
# The working copy, in place of anything published: the CLI from this
|
|
7
|
+
# checkout, and Fisher and Antidote pointed at it. Run it again after a
|
|
8
|
+
# change here, since uv and Fisher copy the files at install.
|
|
7
9
|
install-local:
|
|
8
10
|
uv tool install --force --from . git-worktrees
|
|
9
|
-
|
|
10
|
-
# Undoes install-local: the latest release from PyPI, and only its commands.
|
|
11
|
-
reset:
|
|
12
|
-
uv tool install --force git-worktrees
|
|
13
|
-
|
|
14
|
-
# Points Fisher and Antidote at this checkout. Run it again after a change
|
|
15
|
-
# here, since Fisher copies the files at install.
|
|
16
|
-
local-plugin:
|
|
17
11
|
$(call fish_plugin,$(CURDIR))
|
|
18
12
|
$(call zsh_plugin,$(CURDIR)/zsh/plugins/worktrees)
|
|
19
13
|
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
|
|
14
|
+
# This version as published, in place of anything else: the CLI from PyPI
|
|
15
|
+
# and the shell plugin from GitHub at its tag, so the two match. The
|
|
16
|
+
# Antidote clone goes first, so the next shell clones it at that tag.
|
|
17
|
+
install:
|
|
18
|
+
uv tool install --force git-worktrees==$(VERSION)
|
|
23
19
|
$(call fish_plugin,MihaiBojin/worktrees@v$(VERSION))
|
|
24
20
|
-command -v zsh >/dev/null && test -f "$(ZSH_PLUGINS)" && \
|
|
25
21
|
zsh -ic 'antidote purge MihaiBojin/worktrees' </dev/null
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: git-worktrees
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0
|
|
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
|
|
@@ -103,7 +103,7 @@ the plugin's tag to the same release, as each manager below describes.
|
|
|
103
103
|
### fish
|
|
104
104
|
|
|
105
105
|
```console
|
|
106
|
-
fisher install MihaiBojin/worktrees@v0.
|
|
106
|
+
fisher install MihaiBojin/worktrees@v0.9.0
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
Fisher copies `functions/`, `completions/` and `conf.d/` from the repository
|
|
@@ -120,7 +120,7 @@ the untagged one holds the files.
|
|
|
120
120
|
Antidote takes a `path:` into the repository, and `branch:` takes a tag:
|
|
121
121
|
|
|
122
122
|
```
|
|
123
|
-
MihaiBojin/worktrees branch:v0.
|
|
123
|
+
MihaiBojin/worktrees branch:v0.9.0 path:zsh/plugins/worktrees # in zsh_plugins.txt
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
The plugin puts its own `functions/` and `completions/` on `fpath` and
|
|
@@ -195,8 +195,8 @@ its stdout stays the version alone for a script to read.
|
|
|
195
195
|
An excerpt of `gw --help`'s release lines with matching CLI and shell releases:
|
|
196
196
|
|
|
197
197
|
```console
|
|
198
|
-
worktrees 0.
|
|
199
|
-
The shell plugin here is 0.
|
|
198
|
+
worktrees 0.9.0: git worktree commands that refuse to lose work
|
|
199
|
+
The shell plugin here is 0.9.0, the same release as these commands.
|
|
200
200
|
```
|
|
201
201
|
|
|
202
202
|
A shell without the variable has no plugin loaded, or one older than the
|
|
@@ -585,11 +585,13 @@ an update-ref delete that names no full sha
|
|
|
585
585
|
|
|
586
586
|
## Agent plugin
|
|
587
587
|
|
|
588
|
-
[The agent plugin](plugin/README.md) gives Claude Code and Codex
|
|
588
|
+
[The agent plugin](plugin/README.md) gives Claude Code and Codex seven skills
|
|
589
589
|
over these commands: start a branch, bring a branch level with the head
|
|
590
590
|
branch through its rebase conflicts, read CI, keep a pull request's
|
|
591
|
-
description true to its diff,
|
|
592
|
-
prune finished worktrees and branches after
|
|
591
|
+
description true to its diff, ship a change or an open pull request
|
|
592
|
+
through CI to its merge, prune finished worktrees and branches after
|
|
593
|
+
asking, and add the permission rules shipping needs to Claude Code's
|
|
594
|
+
settings.
|
|
593
595
|
|
|
594
596
|
## Contributing
|
|
595
597
|
|
|
@@ -76,7 +76,7 @@ the plugin's tag to the same release, as each manager below describes.
|
|
|
76
76
|
### fish
|
|
77
77
|
|
|
78
78
|
```console
|
|
79
|
-
fisher install MihaiBojin/worktrees@v0.
|
|
79
|
+
fisher install MihaiBojin/worktrees@v0.9.0
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
Fisher copies `functions/`, `completions/` and `conf.d/` from the repository
|
|
@@ -93,7 +93,7 @@ the untagged one holds the files.
|
|
|
93
93
|
Antidote takes a `path:` into the repository, and `branch:` takes a tag:
|
|
94
94
|
|
|
95
95
|
```
|
|
96
|
-
MihaiBojin/worktrees branch:v0.
|
|
96
|
+
MihaiBojin/worktrees branch:v0.9.0 path:zsh/plugins/worktrees # in zsh_plugins.txt
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
The plugin puts its own `functions/` and `completions/` on `fpath` and
|
|
@@ -168,8 +168,8 @@ its stdout stays the version alone for a script to read.
|
|
|
168
168
|
An excerpt of `gw --help`'s release lines with matching CLI and shell releases:
|
|
169
169
|
|
|
170
170
|
```console
|
|
171
|
-
worktrees 0.
|
|
172
|
-
The shell plugin here is 0.
|
|
171
|
+
worktrees 0.9.0: git worktree commands that refuse to lose work
|
|
172
|
+
The shell plugin here is 0.9.0, the same release as these commands.
|
|
173
173
|
```
|
|
174
174
|
|
|
175
175
|
A shell without the variable has no plugin loaded, or one older than the
|
|
@@ -558,11 +558,13 @@ an update-ref delete that names no full sha
|
|
|
558
558
|
|
|
559
559
|
## Agent plugin
|
|
560
560
|
|
|
561
|
-
[The agent plugin](plugin/README.md) gives Claude Code and Codex
|
|
561
|
+
[The agent plugin](plugin/README.md) gives Claude Code and Codex seven skills
|
|
562
562
|
over these commands: start a branch, bring a branch level with the head
|
|
563
563
|
branch through its rebase conflicts, read CI, keep a pull request's
|
|
564
|
-
description true to its diff,
|
|
565
|
-
prune finished worktrees and branches after
|
|
564
|
+
description true to its diff, ship a change or an open pull request
|
|
565
|
+
through CI to its merge, prune finished worktrees and branches after
|
|
566
|
+
asking, and add the permission rules shipping needs to Claude Code's
|
|
567
|
+
settings.
|
|
566
568
|
|
|
567
569
|
## Contributing
|
|
568
570
|
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
# The release this plugin came from, which `gw --help` and `gw version` compare
|
|
5
5
|
# with their own. Exported, because the environment is all a binary can see
|
|
6
6
|
# of the shell that started it.
|
|
7
|
-
set -gx WORKTREES_PLUGIN_VERSION 0.
|
|
7
|
+
set -gx WORKTREES_PLUGIN_VERSION 0.9.0
|
|
@@ -71,15 +71,23 @@ interpreter comes from uv. [docs/BENCHMARK.md](BENCHMARK.md) is the last run.
|
|
|
71
71
|
## Working on a checkout
|
|
72
72
|
|
|
73
73
|
```console
|
|
74
|
-
make install-local #
|
|
75
|
-
make
|
|
74
|
+
make install-local # this checkout's CLI and shell plugin
|
|
75
|
+
make install # this version as published: the CLI and the shell plugin
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
`make install-local` installs the working copy in place of anything
|
|
79
|
-
published
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
published. `gw` on your `$PATH` is the code in front of you, and Fisher and
|
|
80
|
+
Antidote load the shell plugin from this checkout. Run it again after a
|
|
81
|
+
change, since uv and Fisher copy the files at install.
|
|
82
|
+
|
|
83
|
+
`make install` undoes it: the release `pyproject.toml` names, from PyPI,
|
|
84
|
+
and the shell plugin from GitHub at that release's tag, so the CLI and the
|
|
85
|
+
plugin match. A command only the working copy has, such as one renamed since that
|
|
86
|
+
release, leaves `~/.local/bin` with it.
|
|
87
|
+
|
|
88
|
+
The fish half is skipped where fish or Fisher is missing, and the zsh half
|
|
89
|
+
where Antidote's list is: `$ZDOTDIR/.zsh_plugins.txt`, else
|
|
90
|
+
`~/.zsh_plugins.txt`, or the file `ZSH_PLUGINS=` names.
|
|
83
91
|
|
|
84
92
|
The distribution is `git-worktrees` because PyPI already holds `worktrees`.
|
|
85
93
|
The import package is `worktrees`, and so is the long name of `gw`.
|
|
@@ -57,10 +57,12 @@ What it does depends on the branch, checked in this order:
|
|
|
57
57
|
searched from the tip down, since the first of a squashed pair is not
|
|
58
58
|
upstream on its own, or the source commit of a verified merged request.
|
|
59
59
|
When neither marks one, the forge is asked which merged request carried
|
|
60
|
-
the branch's oldest commit.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
the branch's oldest commit. A commit the forge does not hold, as when
|
|
61
|
+
nobody has pushed the branch, was carried by none. One from another
|
|
62
|
+
branch, into the head branch, whose merge commit the fetched head ref
|
|
63
|
+
holds, marks the newest of the branch's commits it carried: how a
|
|
64
|
+
stacked branch finds its parent's commits when the parent gained more
|
|
65
|
+
before it merged. The forge
|
|
64
66
|
lists at most 100 of a request's commits here, a choice made because a
|
|
65
67
|
parent seldom drifts that far from the branch stacked on it. A request
|
|
66
68
|
with more can mark the boundary too early or not at all, and the rebase
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "worktrees",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Start branches, read CI, rebase onto the head branch, describe, ship and merge pull requests, and prune finished worktrees through the worktrees CLI",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mihai Bojin",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "worktrees",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Start branches, read CI, rebase onto the head branch, describe, ship and merge pull requests, and prune finished worktrees through the worktrees CLI",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mihai Bojin",
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Seven skills for Claude Code and Codex over the worktrees CLI. Each is
|
|
4
4
|
`/worktrees:NAME` in Claude Code and `$worktrees:NAME` in Codex, and an agent
|
|
5
|
-
reaches for one on its own when a task matches its description
|
|
5
|
+
reaches for one on its own when a task matches its description, except
|
|
6
|
+
`preflight`, which runs only when you call it.
|
|
6
7
|
|
|
7
8
|
| skill | does |
|
|
8
9
|
| --- | --- |
|
|
@@ -10,9 +11,9 @@ reaches for one on its own when a task matches its description.
|
|
|
10
11
|
| `fast-forward` | brings this branch level with the head branch, through each rebase conflict |
|
|
11
12
|
| `ci-checks` | reads a pull request's checks as JSON, and waits for them |
|
|
12
13
|
| `describe-pr` | checks a pull request's title and body against its diff, and fixes them |
|
|
13
|
-
| `
|
|
14
|
-
| `ship-it` | commits, pushes, opens the pull request, fixes CI and merges, unassisted |
|
|
14
|
+
| `ship-it` | commits, pushes, opens the pull request, fixes CI and merges, unassisted, for this checkout or the branches it is given; or ships the open pull requests it is given |
|
|
15
15
|
| `prune` | removes the worktrees and branches the CLI proves finished, after asking |
|
|
16
|
+
| `preflight` | adds the permission rules `ship-it` needs to your Claude Code settings, after asking |
|
|
16
17
|
|
|
17
18
|
## Install
|
|
18
19
|
|
|
@@ -61,6 +62,10 @@ and the sandbox has no network and a read-only `.git`. Neither client lets a
|
|
|
61
62
|
plugin grant more, so [the rules ship-it needs](skills/ship-it/rights.md)
|
|
62
63
|
go in your own Claude Code settings or Codex rules, once. `ship-it` checks
|
|
63
64
|
for them before it starts and names any that are missing.
|
|
65
|
+
`/worktrees:preflight user` adds the Claude Code ones to
|
|
66
|
+
`~/.claude/settings.json`, and `/worktrees:preflight project` to the
|
|
67
|
+
repository's `.claude/settings.json`, which reaches every machine that clones
|
|
68
|
+
it once committed.
|
|
64
69
|
|
|
65
70
|
## CI
|
|
66
71
|
|
|
@@ -79,18 +84,6 @@ the diff, the commits or a linked issue. The skill changes only lines that
|
|
|
79
84
|
are wrong or missing, keeps `release-note` blocks, issue keywords and
|
|
80
85
|
harness footers as they were, and says in its reply what it changed.
|
|
81
86
|
|
|
82
|
-
## Merge
|
|
83
|
-
|
|
84
|
-
Asking to merge approves pushing fixes to each named pull request's branch,
|
|
85
|
-
correcting its description, and merging it once green. The skill works in
|
|
86
|
-
the worktree holding the branch, never the main checkout. It merges with
|
|
87
|
-
`.releasetools.yaml`'s `release.merge` or the first strategy the repository
|
|
88
|
-
allows of squash, merge and rebase; a squash keeps GitHub's ` (#NN)` subject
|
|
89
|
-
and the branch's commit trailers, and `--match-head-commit` refuses a head
|
|
90
|
-
that moved after CI passed. It never uses `--admin`, `--auto` or
|
|
91
|
-
`--delete-branch`, and reports a queued merge as queued. The report ends
|
|
92
|
-
with one row per problem: the pull request, what was wrong, what fixed it.
|
|
93
|
-
|
|
94
87
|
## Ship it
|
|
95
88
|
|
|
96
89
|
`/worktrees:ship-it` takes the change in the checkout from uncommitted work
|
|
@@ -98,13 +91,33 @@ to a merged pull request, and asking for it approves every step for that
|
|
|
98
91
|
change: a branch off the head branch when you stand on it, commits by path,
|
|
99
92
|
`gw fast-forward --autostash`, a leased or plain push, the pull request and
|
|
100
93
|
its description, a release note through `release-notes:write` when the
|
|
101
|
-
release-notes plugin is installed, the CI fixes the merge
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
94
|
+
release-notes plugin is installed, the CI fixes, and the merge.
|
|
95
|
+
|
|
96
|
+
`/worktrees:ship-it fix-parser` does the same for the branch `fix-parser`,
|
|
97
|
+
in the worktree that has it checked out, or a new one when none does. On a
|
|
98
|
+
head branch that holds commits its remote does not, it starts the branch on
|
|
99
|
+
them, ships it, then puts the head branch back where its remote is and
|
|
100
|
+
prints the command that undoes that.
|
|
101
|
+
|
|
102
|
+
`/worktrees:ship-it 41 42` ships open pull requests instead, one at a time
|
|
103
|
+
and a stack bottom first. Asking approves pushing fixes to each one's
|
|
104
|
+
branch, correcting its description and merging it once green, in the
|
|
105
|
+
worktree that holds the branch, never the main checkout. A pull request
|
|
106
|
+
stacked on one that did not merge in the same run is not merged.
|
|
107
|
+
|
|
108
|
+
It merges with `.releasetools.yaml`'s `release.merge` or the first strategy
|
|
109
|
+
the repository allows of squash, merge and rebase; a squash keeps GitHub's
|
|
110
|
+
` (#NN)` subject and the branch's commit trailers, and
|
|
111
|
+
`--match-head-commit` refuses a head that moved after CI passed. It never
|
|
112
|
+
uses `--admin`, `--auto` or `--delete-branch`, and reports a merge queue's
|
|
113
|
+
entry as queued, never as merged. It stops and reports where a person has
|
|
114
|
+
to decide, such as a conflict whose sides want incompatible things, a push
|
|
115
|
+
the lease rejects or a blocked merge. When it fixed CI, the pull request
|
|
116
|
+
carries an auto-resolution block, one row per problem, which the squash
|
|
117
|
+
message leaves out. The report ends with one row per problem: the pull
|
|
118
|
+
request, what was wrong, what fixed it. `--hold-merge` does everything but
|
|
119
|
+
the merge, and prints the one `gh` or `glab` command that makes it with the
|
|
120
|
+
prepared subject and body.
|
|
108
121
|
|
|
109
122
|
## Cleanup
|
|
110
123
|
|
|
@@ -140,7 +153,7 @@ The fast-forward skill runs `gw fast-forward --json`, which is what the
|
|
|
140
153
|
shell plugin's `gwff` runs; an agent's shell has no plugin functions, so it
|
|
141
154
|
calls the binary. Arguments to `/worktrees:fast-forward` pass through, so
|
|
142
155
|
`/worktrees:fast-forward next-parser --from release-1.2` names the branch a
|
|
143
|
-
finished one moves to and where it starts. The
|
|
156
|
+
finished one moves to and where it starts. The ship-it skill runs it in the
|
|
144
157
|
checkout holding the head branch once its pull requests land.
|
|
145
158
|
|
|
146
159
|
The CLI decides what happens: fast-forward, rebase, or a new branch when
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "worktrees",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.0",
|
|
5
5
|
"description": "Start branches, read CI, rebase onto the head branch, describe, ship and merge pull requests, and prune finished worktrees through the worktrees CLI",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Mihai Bojin",
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: preflight
|
|
3
|
+
description: >
|
|
4
|
+
Add the Claude Code permission rules this plugin's skills need beyond
|
|
5
|
+
their own pre-approval to the user's or the project's settings.json,
|
|
6
|
+
after showing every missing line and asking. Runs only when the user
|
|
7
|
+
calls it by name.
|
|
8
|
+
disable-model-invocation: true
|
|
9
|
+
argument-hint: "[user | project]"
|
|
10
|
+
allowed-tools:
|
|
11
|
+
- Bash(git rev-parse --show-toplevel)
|
|
12
|
+
- Bash(jq:*)
|
|
13
|
+
- Bash(mktemp)
|
|
14
|
+
- Bash(diff -u:*)
|
|
15
|
+
- Read
|
|
16
|
+
- AskUserQuestion
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Add the plugin's permission rules to Claude Code's settings
|
|
20
|
+
|
|
21
|
+
[rules.json](rules.json) holds the rules a skill's own pre-approval cannot
|
|
22
|
+
cover: the allow rules [ship-it](../ship-it/rights.md) publishes with, and
|
|
23
|
+
the deny rules that refuse a forced push or an admin merge whatever else
|
|
24
|
+
allows them. A plugin cannot grant them, so this skill writes them into a
|
|
25
|
+
settings file the user picks: once per machine, or once per repository.
|
|
26
|
+
|
|
27
|
+
It configures Claude Code alone. In Codex, say so, point at the Codex section
|
|
28
|
+
of [the rules ship-it needs](../ship-it/rights.md), and stop.
|
|
29
|
+
|
|
30
|
+
An allow rule lets every Claude Code session the file covers run that
|
|
31
|
+
command without asking, not just ship-it. Write only the lines the user
|
|
32
|
+
approves in this run, and only after they approve them.
|
|
33
|
+
|
|
34
|
+
## 1. Which file
|
|
35
|
+
|
|
36
|
+
The argument is the scope. With none, ask which one, with this table:
|
|
37
|
+
|
|
38
|
+
| scope | file | reaches |
|
|
39
|
+
| --- | --- | --- |
|
|
40
|
+
| `user` | `~/.claude/settings.json` | every project on this machine |
|
|
41
|
+
| `project` | `.claude/settings.json` under `git rev-parse --show-toplevel` | every machine that clones the repository once the file is committed, after each person trusts the workspace |
|
|
42
|
+
|
|
43
|
+
Any other argument: say that it takes `user` or `project`, and stop.
|
|
44
|
+
|
|
45
|
+
Below, `RULES` is the absolute path of `rules.json` beside this file and
|
|
46
|
+
`TARGET` the chosen file's absolute path. Write both out in every command,
|
|
47
|
+
since nothing carries from one command to the next.
|
|
48
|
+
|
|
49
|
+
## 2. What is missing
|
|
50
|
+
|
|
51
|
+
Where `TARGET` does not exist, every rule is missing. Otherwise:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
jq --slurpfile want RULES '$want[0].permissions as $w | {allow: ($w.allow - (.permissions.allow // [])), deny: ($w.deny - (.permissions.deny // []))}' TARGET
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
When jq cannot read the file, stop: name the file and what jq said, and
|
|
58
|
+
change nothing. When both lists are empty, say the file already carries
|
|
59
|
+
every rule, and stop.
|
|
60
|
+
|
|
61
|
+
## 3. Ask
|
|
62
|
+
|
|
63
|
+
Write the file and every missing line in your reply, allow and deny apart,
|
|
64
|
+
then ask: add them, or stop. Say that the allow lines let any session that
|
|
65
|
+
file covers commit, push, open, edit and merge pull requests, and rerun CI,
|
|
66
|
+
without asking.
|
|
67
|
+
|
|
68
|
+
## 4. Write
|
|
69
|
+
|
|
70
|
+
Merge into a temporary file, show the change, then copy it over the target:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
mktemp
|
|
74
|
+
jq --slurpfile want RULES '$want[0].permissions as $w | .permissions.allow = (.permissions.allow // []) + ($w.allow - (.permissions.allow // [])) | .permissions.deny = (.permissions.deny // []) + ($w.deny - (.permissions.deny // []))' TARGET > TEMP
|
|
75
|
+
diff -u TARGET TEMP
|
|
76
|
+
cp TEMP TARGET
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`TEMP` is the path `mktemp` printed. For a `TARGET` that does not exist,
|
|
80
|
+
run the same program after `{} |` with `jq -n`, and `mkdir -p` the
|
|
81
|
+
directory before the copy.
|
|
82
|
+
|
|
83
|
+
Every other key keeps its value and its place, the rules already there keep
|
|
84
|
+
theirs, and each missing rule is appended once. jq rewrites the layout, with
|
|
85
|
+
two-space indentation. `cp` onto an existing file keeps that file's
|
|
86
|
+
permissions, which matters for a `~/.claude/settings.json` that holds
|
|
87
|
+
secrets in `env`.
|
|
88
|
+
|
|
89
|
+
Nothing here pre-approves the copy, so the client asks before it. Where it
|
|
90
|
+
refuses, print the `cp` command for the user to run with `!`, and stop.
|
|
91
|
+
|
|
92
|
+
## 5. Check and report
|
|
93
|
+
|
|
94
|
+
Run step 2 again: both lists are empty. Report the file and the lines it
|
|
95
|
+
gained. For `project`, the file is not committed: say that it reaches other
|
|
96
|
+
machines once it is merged through a pull request. Never commit it here.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(gw branch create *)",
|
|
5
|
+
"Bash(gw fast-forward *)",
|
|
6
|
+
"Bash(gw ci-checks *)",
|
|
7
|
+
"Bash(git add -- *)",
|
|
8
|
+
"Bash(git commit *)",
|
|
9
|
+
"Bash(git push --set-upstream *)",
|
|
10
|
+
"Bash(git push --force-with-lease --force-if-includes *)",
|
|
11
|
+
"Bash(gh pr create *)",
|
|
12
|
+
"Bash(gh pr edit *)",
|
|
13
|
+
"Bash(gh pr merge *)",
|
|
14
|
+
"Bash(gh run rerun *)",
|
|
15
|
+
"Bash(glab mr create *)",
|
|
16
|
+
"Bash(glab mr update *)",
|
|
17
|
+
"Bash(glab mr merge *)",
|
|
18
|
+
"Bash(glab ci retry *)"
|
|
19
|
+
],
|
|
20
|
+
"deny": [
|
|
21
|
+
"Bash(git push --force *)",
|
|
22
|
+
"Bash(git push * --force)",
|
|
23
|
+
"Bash(gh pr merge * --admin)",
|
|
24
|
+
"Bash(gh pr merge * --admin *)"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|