git-worktrees 0.13.1__tar.gz → 0.13.3__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.13.1 → git_worktrees-0.13.3}/AGENTS.md +4 -2
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/CHANGELOG.md +21 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/PKG-INFO +11 -9
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/README.md +10 -8
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/conf.d/worktrees.fish +1 -1
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/REFERENCE.md +7 -4
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/commands/merge.md +14 -11
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/.claude-plugin/plugin.json +1 -1
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/.codex-plugin/plugin.json +1 -1
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/plugin.json +1 -1
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/pyproject.toml +1 -1
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/branches.py +3 -1
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/pr_merge.py +21 -16
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/verdicts.py +3 -1
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_assessment.py +33 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_pr_merge.py +61 -4
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_removal.py +47 -4
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/uv.lock +1 -1
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/worktrees.plugin.zsh +1 -1
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/.claude/settings.json +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/.codex/config.toml +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/.github/workflows/codeql.yml +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/.github/workflows/publish.yml +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/.github/workflows/testpypi.yml +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/.github/workflows/tests.yml +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/.gitignore +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/.pre-commit-config.yaml +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/.python-version +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/.releasetools.yaml +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/LICENSE +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/Makefile +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/completions/gw.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/completions/worktrees.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/BENCHMARK.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/DEVELOPMENT.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/commands/add.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/commands/branch-create.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/commands/branch-prune.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/commands/branch-status.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/commands/ci-checks.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/commands/fast-forward.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/commands/list.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/commands/preflight.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/commands/push.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/commands/stack-link.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/plans/2026-11-05-worktree-pruning-design.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gw.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gwa.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gwbc.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gwbp.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gwbs.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gwff.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gwl.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gwm.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gwp!.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gwp.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gwpa!.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gwpa.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gwpu.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gwr!.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gwr.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gwrk!.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/functions/gws.fish +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/hatch_build.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/README.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/hooks/codex.json +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/hooks/hooks.json +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/session.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/skills/ci-checks/SKILL.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/skills/describe-pr/SKILL.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/skills/describe-pr/format.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/skills/fast-forward/SKILL.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/skills/preflight/SKILL.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/skills/preflight/agents/openai.yaml +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/skills/preflight/config.toml +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/skills/preflight/merge_codex_rules.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/skills/preflight/project.json +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/skills/preflight/rules.json +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/skills/preflight/worktrees.rules +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/skills/prune/SKILL.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/skills/ship-it/SKILL.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/plugin/skills/ship-it/rights.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/renovate.json +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/scripts/README.md +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/scripts/benchmark.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/scripts/bump_version.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/scripts/verify-publish.bash +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/__init__.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/audit.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/branch_cli.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/branch_forge.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/ci.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/cli.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/errors.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/fast_forward.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/forge.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/git.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/layout.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/merged.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/new_branch.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/pick.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/preflight.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/progress.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/prune.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/push.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/render.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/repo.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/stack_link.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/sync.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/src/worktrees/worktree.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/audit_schema.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/conftest.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_audit.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_benchmark.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_branch_forge.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_branches.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_ci.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_cli.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_command_defaults.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_completions.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_fast_forward.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_fixture.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_forge.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_gates.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_git_records.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_new_branch.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_partial_clone.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_path_boundaries.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_plugin.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_preflight.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_push.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_render.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_shims.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_spec.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_stack_link.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_sync.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_version.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/tests/test_worktree.py +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/completions/_gw +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gw +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gwa +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gwbc +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gwbp +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gwbs +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gwff +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gwl +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gwm +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gwp +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gwp! +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gwpa +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gwpa! +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gwpu +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gwr +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gwr! +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gwrk! +0 -0
- {git_worktrees-0.13.1 → git_worktrees-0.13.3}/zsh/plugins/worktrees/functions/gws +0 -0
|
@@ -805,8 +805,10 @@ state, then whether a remote-tracking ref holds the tip. It returns a reason:
|
|
|
805
805
|
`gw fast-forward` reads it as it is; prune's assessments split `unused` by
|
|
806
806
|
the branch's reflog into `merged`, `unused` and `stale`, and put the
|
|
807
807
|
checkout facts first, `uncommitted` among them. A row's verdict is `remove`
|
|
808
|
-
for `merged` and `stale
|
|
809
|
-
|
|
808
|
+
for `merged` and `stale`, and for any row made eligible by `--delete` or
|
|
809
|
+
`--keep-branch`; every other row reads `keep`. Its reason stays unchanged.
|
|
810
|
+
Tables, JSON, counts and `--only` use this verdict. First-parent history
|
|
811
|
+
belongs to the assessed head, not a divergent local counterpart.
|
|
810
812
|
|
|
811
813
|
Removing a worktree deletes its HEAD reflog and deleting a branch its
|
|
812
814
|
reflog. `merged.reflog_only` lists the commits only those reach, by
|
|
@@ -17,6 +17,27 @@ 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.3 - 2026-11-22
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
Rows made eligible by `--delete` or `--keep-branch` show `remove` in
|
|
25
|
+
worktree and branch assessments. Tables, JSON, counts and `--only` filters
|
|
26
|
+
use that verdict. The reason and deletion protections stay intact.
|
|
27
|
+
|
|
28
|
+
## 0.13.2 - 2026-11-22
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
Single-PR `gw merge` commands preserve commit trailers, including agent
|
|
33
|
+
session IDs, when `--body-file` is omitted. An omitted subject uses the
|
|
34
|
+
pull request title with its number. Explicit message fields remain
|
|
35
|
+
unchanged.
|
|
36
|
+
|
|
37
|
+
Without a complete commit list, provide `--body-file`; otherwise the
|
|
38
|
+
command refuses at exit 3. It also refuses existing asynchronous merges
|
|
39
|
+
whose commit message cannot be verified.
|
|
40
|
+
|
|
20
41
|
## 0.13.1 - 2026-11-21
|
|
21
42
|
|
|
22
43
|
### Fixed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: git-worktrees
|
|
3
|
-
Version: 0.13.
|
|
3
|
+
Version: 0.13.3
|
|
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
|
|
@@ -108,7 +108,7 @@ the plugin's tag to the same release, as each manager below describes.
|
|
|
108
108
|
### fish
|
|
109
109
|
|
|
110
110
|
```console
|
|
111
|
-
fisher install MihaiBojin/worktrees@v0.13.
|
|
111
|
+
fisher install MihaiBojin/worktrees@v0.13.3
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
Fisher copies `functions/`, `completions/` and `conf.d/` from the repository
|
|
@@ -125,7 +125,7 @@ the untagged one holds the files.
|
|
|
125
125
|
Antidote takes a `path:` into the repository, and `branch:` takes a tag:
|
|
126
126
|
|
|
127
127
|
```
|
|
128
|
-
MihaiBojin/worktrees branch:v0.13.
|
|
128
|
+
MihaiBojin/worktrees branch:v0.13.3 path:zsh/plugins/worktrees # in zsh_plugins.txt
|
|
129
129
|
```
|
|
130
130
|
|
|
131
131
|
The plugin puts its own `functions/` and `completions/` on `fpath` and
|
|
@@ -200,8 +200,8 @@ its stdout stays the version alone for a script to read.
|
|
|
200
200
|
An excerpt of `gw --help`'s release lines with matching CLI and shell releases:
|
|
201
201
|
|
|
202
202
|
```console
|
|
203
|
-
worktrees 0.13.
|
|
204
|
-
The shell plugin here is 0.13.
|
|
203
|
+
worktrees 0.13.3: git worktree commands that refuse to lose work
|
|
204
|
+
The shell plugin here is 0.13.3, the same release as these commands.
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
A shell without the variable has no plugin loaded, or one older than the
|
|
@@ -250,8 +250,8 @@ A checked-out branch appears only as its worktree, never as a loose branch.
|
|
|
250
250
|
[Branch status](docs/commands/branch-status.md) describes the proofs;
|
|
251
251
|
[branch prune](docs/commands/branch-prune.md) covers selection and recovery.
|
|
252
252
|
|
|
253
|
-
|
|
254
|
-
|
|
253
|
+
The table shows verdicts without `--delete` or `--keep-branch`. A row's
|
|
254
|
+
`reason` names the first fact in the table that applies:
|
|
255
255
|
|
|
256
256
|
| Reason | Verdict | When |
|
|
257
257
|
| --- | --- | --- |
|
|
@@ -334,8 +334,10 @@ Repeat `--delete` to combine categories:
|
|
|
334
334
|
| `all` | every value above | same |
|
|
335
335
|
|
|
336
336
|
`gw branch status` rejects `--delete`. An unknown or unsupported value is a
|
|
337
|
-
usage error before mutation.
|
|
338
|
-
|
|
337
|
+
usage error before mutation. When `--delete` or `--keep-branch` makes a row
|
|
338
|
+
eligible, its verdict is `remove`; its reason stays unchanged.
|
|
339
|
+
|
|
340
|
+
When only missing values hold worktrees back, `gw prune` says so
|
|
339
341
|
and prints the command that grants them on a line of its own, keeping the
|
|
340
342
|
values you passed, then the worktrees it frees. The command takes no names;
|
|
341
343
|
`gw remove NAME` targets one worktree.
|
|
@@ -81,7 +81,7 @@ the plugin's tag to the same release, as each manager below describes.
|
|
|
81
81
|
### fish
|
|
82
82
|
|
|
83
83
|
```console
|
|
84
|
-
fisher install MihaiBojin/worktrees@v0.13.
|
|
84
|
+
fisher install MihaiBojin/worktrees@v0.13.3
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
Fisher copies `functions/`, `completions/` and `conf.d/` from the repository
|
|
@@ -98,7 +98,7 @@ the untagged one holds the files.
|
|
|
98
98
|
Antidote takes a `path:` into the repository, and `branch:` takes a tag:
|
|
99
99
|
|
|
100
100
|
```
|
|
101
|
-
MihaiBojin/worktrees branch:v0.13.
|
|
101
|
+
MihaiBojin/worktrees branch:v0.13.3 path:zsh/plugins/worktrees # in zsh_plugins.txt
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
The plugin puts its own `functions/` and `completions/` on `fpath` and
|
|
@@ -173,8 +173,8 @@ its stdout stays the version alone for a script to read.
|
|
|
173
173
|
An excerpt of `gw --help`'s release lines with matching CLI and shell releases:
|
|
174
174
|
|
|
175
175
|
```console
|
|
176
|
-
worktrees 0.13.
|
|
177
|
-
The shell plugin here is 0.13.
|
|
176
|
+
worktrees 0.13.3: git worktree commands that refuse to lose work
|
|
177
|
+
The shell plugin here is 0.13.3, the same release as these commands.
|
|
178
178
|
```
|
|
179
179
|
|
|
180
180
|
A shell without the variable has no plugin loaded, or one older than the
|
|
@@ -223,8 +223,8 @@ A checked-out branch appears only as its worktree, never as a loose branch.
|
|
|
223
223
|
[Branch status](docs/commands/branch-status.md) describes the proofs;
|
|
224
224
|
[branch prune](docs/commands/branch-prune.md) covers selection and recovery.
|
|
225
225
|
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
The table shows verdicts without `--delete` or `--keep-branch`. A row's
|
|
227
|
+
`reason` names the first fact in the table that applies:
|
|
228
228
|
|
|
229
229
|
| Reason | Verdict | When |
|
|
230
230
|
| --- | --- | --- |
|
|
@@ -307,8 +307,10 @@ Repeat `--delete` to combine categories:
|
|
|
307
307
|
| `all` | every value above | same |
|
|
308
308
|
|
|
309
309
|
`gw branch status` rejects `--delete`. An unknown or unsupported value is a
|
|
310
|
-
usage error before mutation.
|
|
311
|
-
|
|
310
|
+
usage error before mutation. When `--delete` or `--keep-branch` makes a row
|
|
311
|
+
eligible, its verdict is `remove`; its reason stays unchanged.
|
|
312
|
+
|
|
313
|
+
When only missing values hold worktrees back, `gw prune` says so
|
|
312
314
|
and prints the command that grants them on a line of its own, keeping the
|
|
313
315
|
values you passed, then the worktrees it frees. The command takes no names;
|
|
314
316
|
`gw remove NAME` targets one worktree.
|
|
@@ -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.13.
|
|
7
|
+
set -gx WORKTREES_PLUGIN_VERSION 0.13.3
|
|
@@ -64,8 +64,9 @@ that applies. Checkout facts come first: `main-checkout`, `current`,
|
|
|
64
64
|
`locked`, `missing`, `submodule`, `in-progress` (a rebase, merge,
|
|
65
65
|
cherry-pick, revert or bisect waiting in the worktree's git directory) and
|
|
66
66
|
`uncommitted`, then `protected` for `main`, `master` or the head branch.
|
|
67
|
-
Each of these reads `keep
|
|
68
|
-
|
|
67
|
+
Each of these reads `keep` unless `--keep-branch` makes a protected branch's
|
|
68
|
+
checkout eligible for removal. The branch's proof stays in `proof`. Without
|
|
69
|
+
a checkout or protection fact, the completion checks run in this order:
|
|
69
70
|
|
|
70
71
|
1. Matching cached forge proof gives `merged`.
|
|
71
72
|
2. A tip on the assessed head's first-parent history reads its branch's
|
|
@@ -76,7 +77,9 @@ one, the completion checks run in this order:
|
|
|
76
77
|
5. A cached request at the tip gives `closed` or `open`.
|
|
77
78
|
6. Commits a remote-tracking ref holds give `pushed`, others `unpushed`.
|
|
78
79
|
|
|
79
|
-
`merged` and `stale` read `remove
|
|
80
|
+
`merged` and `stale` read `remove`. Any row made eligible by `--delete` or
|
|
81
|
+
`--keep-branch` also reads `remove`; its reason stays unchanged. Every other
|
|
82
|
+
row reads `keep`. Tables, JSON, counts and `--only` use this verdict.
|
|
80
83
|
|
|
81
84
|
Removal deletes the branch's reflog, and the worktree's own HEAD reflog.
|
|
82
85
|
Assessment lists the commits those reach and no ref, worktree HEAD or kept
|
|
@@ -102,7 +105,7 @@ permits removal.
|
|
|
102
105
|
|
|
103
106
|
## Protections and permissions
|
|
104
107
|
|
|
105
|
-
`eligible` combines
|
|
108
|
+
`eligible` combines completion evidence, deletion permissions and protections.
|
|
106
109
|
`main`, `master` and the assessed head branch cannot be deleted. The main
|
|
107
110
|
checkout, locked worktrees, tracked changes, untracked files and initialized
|
|
108
111
|
submodules block worktree deletion. The submodule refusal names
|
|
@@ -10,20 +10,24 @@ gw merge 42 --match-head-commit FULL_SHA --subject 'Fix parser (#42)' --body-fil
|
|
|
10
10
|
gw merge 41 42 43 --json
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
With one `NUMBER`, `--match-head-commit` is required
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
`
|
|
13
|
+
With one `NUMBER`, `--match-head-commit` is required. An omitted
|
|
14
|
+
`--subject` or `--body-file` uses the corresponding field gw builds below.
|
|
15
|
+
An explicit subject is used as given, including its `(#NUMBER)` suffix.
|
|
16
|
+
`--body-file` reads UTF-8 text unchanged, including trailing newlines;
|
|
17
|
+
that file supplies the trailers the commit needs.
|
|
17
18
|
|
|
18
19
|
With several numbers, gw reads each pull request's head and CI and builds
|
|
19
20
|
each message itself, so `--match-head-commit`, `--subject` and
|
|
20
|
-
`--body-file` are a usage error at exit 2.
|
|
21
|
-
|
|
21
|
+
`--body-file` are a usage error at exit 2.
|
|
22
|
+
|
|
23
|
+
The generated subject is the title and ` (#NUMBER)`. The generated body
|
|
24
|
+
is the pull request's body without the
|
|
22
25
|
`🤖 Generated with` footer line, a bare `https://claude.ai/code/session_...`
|
|
23
26
|
line and the `<details><summary>Auto-resolution</summary>` block, keeping
|
|
24
27
|
any `release-note` block, followed by each of `pr.trailers` from
|
|
25
28
|
[`gw ci-checks`](ci-checks.md) that the body does not already hold. A pull
|
|
26
|
-
request whose `pr.trailers` is null
|
|
29
|
+
request whose `pr.trailers` is null needs an explicit `--body-file`: its
|
|
30
|
+
commit list was incomplete, so gw refuses to build its body.
|
|
27
31
|
|
|
28
32
|
The command always requests squash and accepts no strategy flag. A direct
|
|
29
33
|
squash receives the subject and body; a merge queue controls its own
|
|
@@ -178,10 +182,9 @@ An `enqueued` answer ends polling; it does not mean the PR merged.
|
|
|
178
182
|
|
|
179
183
|
HTTP 400 with `status: failed` is a failed outcome at exit 1, including when
|
|
180
184
|
`gh` exits nonzero. `details.message` supplies its reason. HTTP 409 identifies
|
|
181
|
-
an existing operation. The command
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
commit message.
|
|
185
|
+
an existing operation. The command refuses to adopt it because GitHub
|
|
186
|
+
does not echo that operation's commit message, so its trailers cannot be
|
|
187
|
+
verified.
|
|
185
188
|
|
|
186
189
|
With one number, a refusal exits 3 and prints its reason on stderr. Invalid
|
|
187
190
|
arguments exit 2. Unknown statuses, malformed responses and network failures
|
|
@@ -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.13.
|
|
4
|
+
"version": "0.13.3",
|
|
5
5
|
"description": "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",
|
|
@@ -9,7 +9,7 @@ authors = [
|
|
|
9
9
|
]
|
|
10
10
|
# Static, and the single source of truth for the version. Bump it in a pull
|
|
11
11
|
# request and run `uv lock`; the release tag only has to agree with it.
|
|
12
|
-
version = "0.13.
|
|
12
|
+
version = "0.13.3"
|
|
13
13
|
# The standard library answers every question this asks. A dependency here
|
|
14
14
|
# would be paid on every invocation, and an invocation is 67 ms of which 25 ms
|
|
15
15
|
# is the interpreter starting.
|
|
@@ -170,7 +170,6 @@ def _judge(
|
|
|
170
170
|
else []
|
|
171
171
|
)
|
|
172
172
|
row.reason, row.evidence = deciding[0] if deciding else (evidence, why)
|
|
173
|
-
row.verdict = REMOVE if row.reason in (merged.MERGED, merged.STALE) else KEEP
|
|
174
173
|
|
|
175
174
|
|
|
176
175
|
def _standing(
|
|
@@ -195,6 +194,9 @@ def _settle(
|
|
|
195
194
|
return row.found[0] in DONE and not _standing(row, hard, head_branch, values)
|
|
196
195
|
|
|
197
196
|
row.eligible = eligible(granted)
|
|
197
|
+
row.verdict = (
|
|
198
|
+
REMOVE if row.eligible or row.reason in (merged.MERGED, merged.STALE) else KEEP
|
|
199
|
+
)
|
|
198
200
|
row.needs = () if row.eligible else prune.needed(eligible, PERMISSIONS) or ()
|
|
199
201
|
row.facts = _standing(row, hard, head_branch, granted)
|
|
200
202
|
row.protections = prune.hinted(row.facts, row.needs)
|
|
@@ -530,6 +530,23 @@ def merge(number: int, sha: str, subject: str | None, body: str | None) -> dict:
|
|
|
530
530
|
snapshot = _snapshot(number)
|
|
531
531
|
pr = snapshot["pr"]
|
|
532
532
|
_ready(snapshot, sha)
|
|
533
|
+
if subject is None or body is None:
|
|
534
|
+
trailers = pr["trailers"]
|
|
535
|
+
if body is None and trailers is None:
|
|
536
|
+
raise Refused(
|
|
537
|
+
f"#{number} commit list is incomplete, so its trailers "
|
|
538
|
+
"cannot be read; merge it alone with --subject and --body-file"
|
|
539
|
+
)
|
|
540
|
+
row = _pull(repository, number)
|
|
541
|
+
title = row.get("title")
|
|
542
|
+
text = row.get("body") or ""
|
|
543
|
+
if not isinstance(title, str) or not isinstance(text, str):
|
|
544
|
+
raise Refused(f"#{number} has no readable title and body")
|
|
545
|
+
default_subject, default_body = message(number, title, text, trailers or [])
|
|
546
|
+
if subject is None:
|
|
547
|
+
subject = default_subject
|
|
548
|
+
if body is None:
|
|
549
|
+
body = default_body
|
|
533
550
|
for member, head in scope.lower:
|
|
534
551
|
_ready(_snapshot(member), head)
|
|
535
552
|
warnings = _squash_settings(repository, scope.lower) if scope.lower else []
|
|
@@ -573,9 +590,9 @@ def merge(number: int, sha: str, subject: str | None, body: str | None) -> dict:
|
|
|
573
590
|
f"{exc}\nThe merge of #{number}{operation} may still complete. "
|
|
574
591
|
"Read the pull request before submitting another merge."
|
|
575
592
|
) from None
|
|
576
|
-
|
|
593
|
+
notice = str(details.get("message") or "")
|
|
577
594
|
if status == "pending":
|
|
578
|
-
|
|
595
|
+
notice = (
|
|
579
596
|
"Merge still pending after the polling window; it may still complete. "
|
|
580
597
|
"Read the PR before retrying."
|
|
581
598
|
)
|
|
@@ -603,7 +620,7 @@ def merge(number: int, sha: str, subject: str | None, body: str | None) -> dict:
|
|
|
603
620
|
"pr": pr,
|
|
604
621
|
"sha": details.get("sha"),
|
|
605
622
|
"uuid": uuid or None,
|
|
606
|
-
"message":
|
|
623
|
+
"message": notice,
|
|
607
624
|
"merged": done,
|
|
608
625
|
"remaining": remaining,
|
|
609
626
|
"branches": branches,
|
|
@@ -694,19 +711,7 @@ def ship(numbers: list[int]) -> list[dict]:
|
|
|
694
711
|
snapshot = _snapshot(number)
|
|
695
712
|
pr = snapshot["pr"]
|
|
696
713
|
head = pr["headSha"]
|
|
697
|
-
|
|
698
|
-
if trailers is None:
|
|
699
|
-
raise Refused(
|
|
700
|
-
f"#{number} commit list is incomplete, so its trailers "
|
|
701
|
-
"cannot be read; merge it alone with --subject and --body-file"
|
|
702
|
-
)
|
|
703
|
-
row = _pull(repository, number)
|
|
704
|
-
title = row.get("title")
|
|
705
|
-
body = row.get("body") or ""
|
|
706
|
-
if not isinstance(title, str) or not isinstance(body, str):
|
|
707
|
-
raise Refused(f"#{number} has no readable title and body")
|
|
708
|
-
subject, text = message(number, title, body, trailers)
|
|
709
|
-
result = merge(number, head, subject, text)
|
|
714
|
+
result = merge(number, head, None, None)
|
|
710
715
|
except Refused as exc:
|
|
711
716
|
remaining, _ = _left([*covered, number], {})
|
|
712
717
|
result = {
|
|
@@ -374,7 +374,9 @@ def assess(
|
|
|
374
374
|
lambda values: eligible(values, keep=True), PERMISSIONS
|
|
375
375
|
)
|
|
376
376
|
row = Verdict(
|
|
377
|
-
REMOVE
|
|
377
|
+
REMOVE
|
|
378
|
+
if eligible(granted) or reason in (merged.MERGED, merged.STALE)
|
|
379
|
+
else KEEP,
|
|
378
380
|
wt.branch,
|
|
379
381
|
wt.path,
|
|
380
382
|
decided,
|
|
@@ -380,6 +380,39 @@ def test_keep_filter_preserves_ineligible_kept_rows(world):
|
|
|
380
380
|
assert all(r["verdict"] == "keep" and not r["eligible"] for r in result)
|
|
381
381
|
|
|
382
382
|
|
|
383
|
+
@pytest.mark.parametrize("detached", [False, True])
|
|
384
|
+
@pytest.mark.parametrize("permission", [False, True])
|
|
385
|
+
def test_empty_permission_sets_the_table_verdict_and_filter(
|
|
386
|
+
world, detached, permission
|
|
387
|
+
):
|
|
388
|
+
path = world.worktree("empty")
|
|
389
|
+
if detached:
|
|
390
|
+
world.git("checkout", "--quiet", "--detach", at=path)
|
|
391
|
+
locked = world.worktree("locked")
|
|
392
|
+
world.git("worktree", "lock", str(locked))
|
|
393
|
+
flags = ["--delete", "empty", "--delete", "reflog"] if permission else []
|
|
394
|
+
result = run(world, "gw prune", *flags, "--table")
|
|
395
|
+
assert result.returncode == 0, result.stderr
|
|
396
|
+
label = "(detached)" if detached else "empty"
|
|
397
|
+
line = next(line for line in result.stdout.splitlines() if label in line)
|
|
398
|
+
cells = [cell.strip() for cell in line.split("|")[1:-1]]
|
|
399
|
+
assert cells == [
|
|
400
|
+
label,
|
|
401
|
+
"remove" if permission else "keep",
|
|
402
|
+
"unused",
|
|
403
|
+
"yes" if permission else "no",
|
|
404
|
+
]
|
|
405
|
+
removable = rows(world, "gw prune", *flags, "--only", "remove")
|
|
406
|
+
assert [r["path"] for r in removable] == ([str(path)] if permission else [])
|
|
407
|
+
kept = rows(world, "gw prune", *flags, "--only", "keep")
|
|
408
|
+
assert {r["branch"] for r in kept} == (
|
|
409
|
+
{"main", "locked"}
|
|
410
|
+
if permission
|
|
411
|
+
else {"main", "locked", "" if detached else "empty"}
|
|
412
|
+
)
|
|
413
|
+
assert path.exists() and locked.exists()
|
|
414
|
+
|
|
415
|
+
|
|
383
416
|
@pytest.mark.parametrize(
|
|
384
417
|
"args",
|
|
385
418
|
[
|
|
@@ -31,6 +31,8 @@ def pull(**extra) -> dict:
|
|
|
31
31
|
"state": "open",
|
|
32
32
|
"draft": False,
|
|
33
33
|
"merged": False,
|
|
34
|
+
"title": "Seven",
|
|
35
|
+
"body": "Body.",
|
|
34
36
|
"head": {"ref": "feature", "sha": HEAD},
|
|
35
37
|
"base": {"ref": "main", "repo": {"full_name": "owner/repo"}},
|
|
36
38
|
**extra,
|
|
@@ -147,6 +149,61 @@ def test_merge_pins_head_and_preserves_message_bytes(world, github) -> None:
|
|
|
147
149
|
assert not any(c[:2] == ["git", "fetch"] for c in github.network_calls())
|
|
148
150
|
|
|
149
151
|
|
|
152
|
+
@pytest.mark.parametrize("subject", [None, "Custom (#7)"])
|
|
153
|
+
@pytest.mark.parametrize("body", [None, "", "Override body.\n\n"])
|
|
154
|
+
def test_single_merge_fills_omitted_message_fields(
|
|
155
|
+
world, github, subject: str | None, body: str | None
|
|
156
|
+
) -> None:
|
|
157
|
+
commits = [
|
|
158
|
+
{
|
|
159
|
+
"oid": HEAD,
|
|
160
|
+
"messageHeadline": "Change",
|
|
161
|
+
"messageBody": f"{TRAILER}\nCodex-Session: abc",
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
github.answer(
|
|
165
|
+
{"$view": _pr(commits=commits), "$api": {PR: pull(), ASYNC: merged()}}
|
|
166
|
+
)
|
|
167
|
+
args = []
|
|
168
|
+
if subject is not None:
|
|
169
|
+
args.extend(["--subject", subject])
|
|
170
|
+
if body is not None:
|
|
171
|
+
path = world.root / "message.txt"
|
|
172
|
+
path.write_text(body)
|
|
173
|
+
args.extend(["--body-file", str(path)])
|
|
174
|
+
proc = run(world, github, *args)
|
|
175
|
+
assert proc.returncode == 0, proc.stderr
|
|
176
|
+
calls = writes(github)
|
|
177
|
+
assert len(calls) == 1
|
|
178
|
+
expected_title = "Seven (#7)" if subject is None else "Custom (#7)"
|
|
179
|
+
expected_body = (
|
|
180
|
+
f"Body.\n\n{TRAILER}\nCodex-Session: abc\n" if body is None else body
|
|
181
|
+
)
|
|
182
|
+
assert "sha=" + HEAD in calls[0]
|
|
183
|
+
assert "commit_title=" + expected_title in calls[0]
|
|
184
|
+
assert "commit_message=" + expected_body in calls[0]
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def test_automatic_body_refuses_incomplete_trailers(world, github) -> None:
|
|
188
|
+
github.answer({"$view": _pr(commits=None), "$api": {PR: pull(), ASYNC: merged()}})
|
|
189
|
+
proc = run(world, github)
|
|
190
|
+
assert proc.returncode == 3
|
|
191
|
+
assert "commit list is incomplete" in proc.stderr
|
|
192
|
+
assert not writes(github)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def test_explicit_body_can_merge_with_incomplete_trailers(world, github) -> None:
|
|
196
|
+
github.answer({"$view": _pr(commits=None), "$api": {PR: pull(), ASYNC: merged()}})
|
|
197
|
+
path = world.root / "message.txt"
|
|
198
|
+
path.write_text("Provided body.\n")
|
|
199
|
+
proc = run(world, github, "--body-file", str(path))
|
|
200
|
+
assert proc.returncode == 0, proc.stderr
|
|
201
|
+
calls = writes(github)
|
|
202
|
+
assert len(calls) == 1
|
|
203
|
+
assert "commit_title=Seven (#7)" in calls[0]
|
|
204
|
+
assert "commit_message=Provided body.\n" in calls[0]
|
|
205
|
+
|
|
206
|
+
|
|
150
207
|
def test_native_bottom_pr_merges_without_merging_the_child(world, github) -> None:
|
|
151
208
|
answer(github, **{PR: pull(stack=stack_info()), STACK: stack()})
|
|
152
209
|
proc = run(world, github)
|
|
@@ -245,12 +302,12 @@ def test_each_terminal_outcome(world, github, response, expected, code, poll) ->
|
|
|
245
302
|
assert "Required review missing" in proc.stderr
|
|
246
303
|
|
|
247
304
|
|
|
248
|
-
def
|
|
305
|
+
def test_existing_request_cannot_verify_an_automatic_message(world, github) -> None:
|
|
249
306
|
answer(github, **{ASYNC: {"$http": 409, "$body": pending()}, OPERATION: merged()})
|
|
250
307
|
proc = run(world, github)
|
|
251
|
-
assert proc.returncode ==
|
|
252
|
-
assert
|
|
253
|
-
assert
|
|
308
|
+
assert proc.returncode == 3
|
|
309
|
+
assert "message" in proc.stderr
|
|
310
|
+
assert not any(OPERATION in c for c in github.network_calls())
|
|
254
311
|
|
|
255
312
|
|
|
256
313
|
@pytest.mark.parametrize(
|
|
@@ -38,7 +38,7 @@ def stash(world, path, subject="pending") -> str:
|
|
|
38
38
|
("empty", "empty", "stashes"),
|
|
39
39
|
],
|
|
40
40
|
)
|
|
41
|
-
def
|
|
41
|
+
def test_permissions_make_an_unused_verdict_removable(world, entry, values):
|
|
42
42
|
path = world.worktree("topic")
|
|
43
43
|
sha = stash(world, path)
|
|
44
44
|
if entry == "gw branch prune":
|
|
@@ -46,15 +46,37 @@ def test_permissions_combine_without_changing_an_unused_verdict(world, entry, va
|
|
|
46
46
|
args = [] if entry == "gw prune" else ["topic"]
|
|
47
47
|
for value in values:
|
|
48
48
|
args += ["--delete", value]
|
|
49
|
+
preview = run(
|
|
50
|
+
world,
|
|
51
|
+
entry,
|
|
52
|
+
*args,
|
|
53
|
+
"--json",
|
|
54
|
+
*(["--dry-run"] if entry == "gw branch prune" else []),
|
|
55
|
+
)
|
|
56
|
+
assert preview.returncode == 0, preview.stderr
|
|
57
|
+
row = next(
|
|
58
|
+
r for r in json.loads(preview.stdout)["verdicts"] if r["branch"] == "topic"
|
|
59
|
+
)
|
|
60
|
+
assert (row["verdict"], row["reason"], row["eligible"]) == (
|
|
61
|
+
"remove",
|
|
62
|
+
"unused",
|
|
63
|
+
True,
|
|
64
|
+
)
|
|
49
65
|
p = run(world, entry, *args, "--yes", "--json")
|
|
50
66
|
assert p.returncode == 0, p.stderr
|
|
51
67
|
assert not path.exists()
|
|
52
68
|
assert "topic" not in world.git("branch", "--format=%(refname:short)").splitlines()
|
|
53
69
|
assert not world.git("stash", "list")
|
|
54
70
|
assert sha in p.stderr
|
|
55
|
-
if entry
|
|
56
|
-
row =
|
|
57
|
-
|
|
71
|
+
if entry != "gw remove":
|
|
72
|
+
row = next(
|
|
73
|
+
r for r in json.loads(p.stdout)["verdicts"] if r["branch"] == "topic"
|
|
74
|
+
)
|
|
75
|
+
assert (row["verdict"], row["reason"], row["eligible"]) == (
|
|
76
|
+
"remove",
|
|
77
|
+
"unused",
|
|
78
|
+
True,
|
|
79
|
+
)
|
|
58
80
|
|
|
59
81
|
|
|
60
82
|
@pytest.mark.parametrize(
|
|
@@ -84,6 +106,23 @@ def test_invalid_permission_is_usage_before_repository_preflight(world, args):
|
|
|
84
106
|
assert world.git("rev-parse", "refs/heads/topic")
|
|
85
107
|
|
|
86
108
|
|
|
109
|
+
@pytest.mark.parametrize("entry", ["gw prune", "gw remove", "gw branch prune"])
|
|
110
|
+
@pytest.mark.parametrize("permission", ["empty", "stashes"])
|
|
111
|
+
def test_partial_permissions_keep_an_unused_verdict(world, entry, permission):
|
|
112
|
+
path = world.worktree("topic")
|
|
113
|
+
stash(world, path)
|
|
114
|
+
args = [] if entry == "gw prune" else ["topic"]
|
|
115
|
+
if entry == "gw branch prune":
|
|
116
|
+
world.git("worktree", "remove", str(path))
|
|
117
|
+
args += ["--dry-run"]
|
|
118
|
+
result = run(world, entry, *args, "--delete", permission, "--json")
|
|
119
|
+
assert result.returncode == 0, result.stderr
|
|
120
|
+
row = next(
|
|
121
|
+
r for r in json.loads(result.stdout)["verdicts"] if r["branch"] == "topic"
|
|
122
|
+
)
|
|
123
|
+
assert (row["verdict"], row["reason"], row["eligible"]) == ("keep", "unused", False)
|
|
124
|
+
|
|
125
|
+
|
|
87
126
|
@pytest.mark.parametrize("kind", ["empty", "unfinished", "finished", "main", "master"])
|
|
88
127
|
def test_keep_branch_keeps_ref_and_stashes_even_when_protected(world, kind):
|
|
89
128
|
path = (
|
|
@@ -100,6 +139,10 @@ def test_keep_branch_keeps_ref_and_stashes_even_when_protected(world, kind):
|
|
|
100
139
|
branch = kind if kind in ("main", "master") else "topic"
|
|
101
140
|
tip = world.git("rev-parse", "HEAD", at=path)
|
|
102
141
|
sha = stash(world, path)
|
|
142
|
+
preview = run(world, "gw remove", str(path), "--keep-branch", "--json")
|
|
143
|
+
assert preview.returncode == 0, preview.stderr
|
|
144
|
+
row = json.loads(preview.stdout)["verdicts"][0]
|
|
145
|
+
assert row["verdict"] == "remove" and row["eligible"]
|
|
103
146
|
p = run(world, "gw remove", str(path), "--keep-branch", "--yes", "--quiet")
|
|
104
147
|
assert p.returncode == 0, p.stderr
|
|
105
148
|
assert not path.exists()
|
|
@@ -12,4 +12,4 @@ autoload -Uz gw gwa gwbc gwbp gwbs gwff gwl gwm gwp 'gwp!' gwpa 'gwpa!' gwpu gwr
|
|
|
12
12
|
# The release this plugin came from, which `gw --help` and `gw version` compare
|
|
13
13
|
# with their own. Exported, because the environment is all a binary can see
|
|
14
14
|
# of the shell that started it.
|
|
15
|
-
export WORKTREES_PLUGIN_VERSION=0.13.
|
|
15
|
+
export WORKTREES_PLUGIN_VERSION=0.13.3
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{git_worktrees-0.13.1 → git_worktrees-0.13.3}/docs/plans/2026-11-05-worktree-pruning-design.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|