git-worktrees 0.13.4__tar.gz → 0.14.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.
Files changed (160) hide show
  1. git_worktrees-0.14.0/.agents/plugins/marketplace.json +20 -0
  2. git_worktrees-0.14.0/.claude-plugin/marketplace.json +15 -0
  3. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/.github/workflows/publish.yml +30 -5
  4. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/AGENTS.md +15 -3
  5. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/CHANGELOG.md +14 -0
  6. git_worktrees-0.14.0/PKG-INFO +335 -0
  7. git_worktrees-0.14.0/README.md +308 -0
  8. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/completions/gw.fish +2 -2
  9. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/conf.d/worktrees.fish +1 -1
  10. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/docs/DEVELOPMENT.md +13 -3
  11. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/docs/REFERENCE.md +91 -8
  12. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/.claude-plugin/plugin.json +1 -1
  13. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/.codex-plugin/plugin.json +1 -1
  14. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/README.md +13 -0
  15. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/plugin.json +1 -1
  16. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/skills/describe-pr/SKILL.md +1 -1
  17. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/skills/describe-pr/format.md +1 -1
  18. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/skills/prune/SKILL.md +9 -4
  19. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/skills/ship-it/SKILL.md +1 -1
  20. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/pyproject.toml +1 -1
  21. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/cli.py +20 -6
  22. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/prune.py +8 -1
  23. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/repo.py +10 -6
  24. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/verdicts.py +77 -13
  25. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/worktree.py +7 -1
  26. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_assessment.py +110 -1
  27. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_branches.py +6 -3
  28. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_completions.py +35 -12
  29. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_plugin.py +24 -0
  30. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/uv.lock +1 -1
  31. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/completions/_gw +2 -2
  32. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/worktrees.plugin.zsh +1 -1
  33. git_worktrees-0.13.4/PKG-INFO +0 -762
  34. git_worktrees-0.13.4/README.md +0 -735
  35. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/.claude/settings.json +0 -0
  36. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/.codex/config.toml +0 -0
  37. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/.github/workflows/codeql.yml +0 -0
  38. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/.github/workflows/testpypi.yml +0 -0
  39. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/.github/workflows/tests.yml +0 -0
  40. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/.gitignore +0 -0
  41. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/.pre-commit-config.yaml +0 -0
  42. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/.python-version +0 -0
  43. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/.releasetools.yaml +0 -0
  44. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/LICENSE +0 -0
  45. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/Makefile +0 -0
  46. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/completions/worktrees.fish +0 -0
  47. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/docs/BENCHMARK.md +0 -0
  48. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/docs/commands/add.md +0 -0
  49. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/docs/commands/branch-create.md +0 -0
  50. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/docs/commands/branch-prune.md +0 -0
  51. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/docs/commands/branch-status.md +0 -0
  52. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/docs/commands/ci-checks.md +0 -0
  53. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/docs/commands/fast-forward.md +0 -0
  54. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/docs/commands/list.md +0 -0
  55. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/docs/commands/merge.md +0 -0
  56. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/docs/commands/preflight.md +0 -0
  57. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/docs/commands/push.md +0 -0
  58. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/docs/commands/stack-link.md +0 -0
  59. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/docs/plans/2026-11-05-worktree-pruning-design.md +0 -0
  60. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gw.fish +0 -0
  61. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gwa.fish +0 -0
  62. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gwbc.fish +0 -0
  63. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gwbp.fish +0 -0
  64. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gwbs.fish +0 -0
  65. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gwff.fish +0 -0
  66. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gwl.fish +0 -0
  67. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gwm.fish +0 -0
  68. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gwp!.fish +0 -0
  69. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gwp.fish +0 -0
  70. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gwpa!.fish +0 -0
  71. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gwpa.fish +0 -0
  72. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gwpu.fish +0 -0
  73. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gwr!.fish +0 -0
  74. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gwr.fish +0 -0
  75. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gwrk!.fish +0 -0
  76. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/functions/gws.fish +0 -0
  77. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/hatch_build.py +0 -0
  78. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/hooks/codex.json +0 -0
  79. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/hooks/hooks.json +0 -0
  80. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/session.md +0 -0
  81. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/skills/ci-checks/SKILL.md +0 -0
  82. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/skills/fast-forward/SKILL.md +0 -0
  83. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/skills/preflight/SKILL.md +0 -0
  84. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/skills/preflight/agents/openai.yaml +0 -0
  85. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/skills/preflight/config.toml +0 -0
  86. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/skills/preflight/merge_codex_rules.py +0 -0
  87. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/skills/preflight/project.json +0 -0
  88. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/skills/preflight/rules.json +0 -0
  89. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/skills/preflight/worktrees.rules +0 -0
  90. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/plugin/skills/ship-it/rights.md +0 -0
  91. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/renovate.json +0 -0
  92. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/scripts/README.md +0 -0
  93. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/scripts/benchmark.py +0 -0
  94. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/scripts/bump_version.py +0 -0
  95. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/scripts/verify-publish.bash +0 -0
  96. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/__init__.py +0 -0
  97. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/audit.py +0 -0
  98. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/branch_cli.py +0 -0
  99. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/branch_forge.py +0 -0
  100. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/branches.py +0 -0
  101. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/ci.py +0 -0
  102. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/errors.py +0 -0
  103. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/fast_forward.py +0 -0
  104. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/forge.py +0 -0
  105. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/git.py +0 -0
  106. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/layout.py +0 -0
  107. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/merged.py +0 -0
  108. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/new_branch.py +0 -0
  109. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/pick.py +0 -0
  110. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/pr_merge.py +0 -0
  111. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/preflight.py +0 -0
  112. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/progress.py +0 -0
  113. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/push.py +0 -0
  114. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/render.py +0 -0
  115. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/stack_link.py +0 -0
  116. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/src/worktrees/sync.py +0 -0
  117. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/audit_schema.py +0 -0
  118. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/conftest.py +0 -0
  119. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_audit.py +0 -0
  120. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_benchmark.py +0 -0
  121. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_branch_forge.py +0 -0
  122. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_ci.py +0 -0
  123. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_cli.py +0 -0
  124. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_command_defaults.py +0 -0
  125. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_fast_forward.py +0 -0
  126. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_fixture.py +0 -0
  127. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_forge.py +0 -0
  128. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_gates.py +0 -0
  129. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_git_records.py +0 -0
  130. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_new_branch.py +0 -0
  131. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_partial_clone.py +0 -0
  132. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_path_boundaries.py +0 -0
  133. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_pr_merge.py +0 -0
  134. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_preflight.py +0 -0
  135. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_push.py +0 -0
  136. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_removal.py +0 -0
  137. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_render.py +0 -0
  138. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_shims.py +0 -0
  139. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_spec.py +0 -0
  140. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_stack_link.py +0 -0
  141. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_sync.py +0 -0
  142. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_version.py +0 -0
  143. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/tests/test_worktree.py +0 -0
  144. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gw +0 -0
  145. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gwa +0 -0
  146. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gwbc +0 -0
  147. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gwbp +0 -0
  148. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gwbs +0 -0
  149. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gwff +0 -0
  150. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gwl +0 -0
  151. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gwm +0 -0
  152. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gwp +0 -0
  153. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gwp! +0 -0
  154. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gwpa +0 -0
  155. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gwpa! +0 -0
  156. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gwpu +0 -0
  157. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gwr +0 -0
  158. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gwr! +0 -0
  159. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gwrk! +0 -0
  160. {git_worktrees-0.13.4 → git_worktrees-0.14.0}/zsh/plugins/worktrees/functions/gws +0 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "worktrees",
3
+ "interface": {
4
+ "displayName": "worktrees"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "worktrees",
9
+ "source": {
10
+ "source": "local",
11
+ "path": "./plugin"
12
+ },
13
+ "policy": {
14
+ "installation": "AVAILABLE",
15
+ "authentication": "ON_INSTALL"
16
+ },
17
+ "category": "Developer Tools"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "worktrees",
3
+ "owner": {
4
+ "name": "Mihai Bojin",
5
+ "url": "https://github.com/MihaiBojin"
6
+ },
7
+ "description": "The worktrees agent plugin, from the repository that holds its CLI",
8
+ "plugins": [
9
+ {
10
+ "name": "worktrees",
11
+ "source": "./plugin",
12
+ "description": "Read CI, rebase onto the head branch, describe, ship and merge pull requests, and prune finished worktrees through the worktrees CLI"
13
+ }
14
+ ]
15
+ }
@@ -402,7 +402,7 @@ jobs:
402
402
 
403
403
  # signed-push commits onto a branch that exists, so the branch starts at
404
404
  # the marketplace's main. A rerun finds it: with its pull request open
405
- # there is nothing left to do, and without one a person decides.
405
+ # it goes on to the merge, and without one a person decides.
406
406
  - name: Create the branch
407
407
  id: branch
408
408
  if: steps.bump.outputs.changed == 'true'
@@ -418,6 +418,7 @@ jobs:
418
418
  if [ -n "$open" ]; then
419
419
  echo "$branch already has a pull request: $open" >&2
420
420
  echo "action=none" >>"$GITHUB_OUTPUT"
421
+ echo "pr=$open" >>"$GITHUB_OUTPUT"
421
422
  exit 0
422
423
  fi
423
424
  echo "::error::$MARKETPLACE has a branch $branch with no open pull request. Open one for it or delete it, then re-run this job."
@@ -443,9 +444,9 @@ jobs:
443
444
  prune: "false"
444
445
  token: ${{ steps.app-token.outputs.token }}
445
446
 
446
- # Opened as the App, so the marketplace's own checks run on it. Merging
447
- # is left to a person.
447
+ # Opened as the App, so the marketplace's own checks run on it.
448
448
  - name: Open the pull request
449
+ id: open
449
450
  if: steps.branch.outputs.action == 'commit'
450
451
  env:
451
452
  GH_TOKEN: ${{ steps.app-token.outputs.token }}
@@ -455,5 +456,29 @@ jobs:
455
456
  body="$(printf '%s\n\n%s\n' \
456
457
  "The \`worktrees\` listing installs the plugin from its $TAG tag." \
457
458
  "Opened by [$GITHUB_REPOSITORY's publish run]($RUN).")"
458
- gh pr create --repo "$MARKETPLACE" --base main --head "$BRANCH" \
459
- --title "chore(worktrees): List $TAG" --body "$body"
459
+ url="$(gh pr create --repo "$MARKETPLACE" --base main --head "$BRANCH" \
460
+ --title "chore(worktrees): List $TAG" --body "$body")"
461
+ echo "$url"
462
+ echo "pr=$url" >>"$GITHUB_OUTPUT"
463
+
464
+ # The marketplace's main requires no checks, so the job waits for them
465
+ # itself. They register a few seconds after the pull request opens, and
466
+ # `gh pr checks` reports none until then. A failed check, or none after
467
+ # five minutes, fails the job and leaves the pull request to a person.
468
+ # The squash is pinned to the head the checks ran on.
469
+ - name: Merge the pull request once its checks pass
470
+ if: steps.open.outputs.pr != '' || steps.branch.outputs.pr != ''
471
+ timeout-minutes: 30
472
+ env:
473
+ GH_TOKEN: ${{ steps.app-token.outputs.token }}
474
+ PR: ${{ steps.open.outputs.pr || steps.branch.outputs.pr }}
475
+ run: |
476
+ set -euo pipefail
477
+ head="$(gh pr view "$PR" --json headRefOid --jq .headRefOid)"
478
+ for _ in $(seq 60); do
479
+ count="$(gh pr checks "$PR" --json name --jq length 2>/dev/null || true)"
480
+ if [ -n "$count" ] && [ "$count" != 0 ]; then break; fi
481
+ sleep 5
482
+ done
483
+ gh pr checks "$PR" --watch --fail-fast --interval 10
484
+ gh pr merge "$PR" --squash --match-head-commit "$head"
@@ -254,7 +254,7 @@ assumes a plugin root or a checkout at a known path.
254
254
 
255
255
  `describe-pr` and `ship-it` share `describe-pr/format.md`: the
256
256
  review's title and body are the squash commit's subject and body, so one set
257
- of rules writes both. When the agent has the technical-writing plugin's
257
+ of rules writes both. When the agent has the technical-writer plugin's
258
258
  `pr-description` skill, both write the title and the body in that skill's
259
259
  format, and `format.md` keeps what to preserve, the auto-resolution block
260
260
  and the four ways a description is wrong. `tests/test_plugin.py` holds every skill's
@@ -323,6 +323,13 @@ The plugin carries the release version in three manifests, and
323
323
  portable manifest, the Claude one with only the fields Agent Plugins v1 names;
324
324
  the same test holds it to that.
325
325
 
326
+ The repository root is a marketplace named `worktrees`, one catalog a
327
+ client, whose one entry is `./plugin`: `worktrees@worktrees`. Neither
328
+ catalog names a version or a tag, so a release stamps nothing there, and
329
+ `tests/test_plugin.py` holds both to that. `MihaiBojin/agent-plugins` lists
330
+ the same plugin as `worktrees@mihaibojin`, pinned to a release tag that the
331
+ `list` job in `publish.yml` moves; preflight sets up that one.
332
+
326
333
  ## The picker is Python's, and there is no fzf
327
334
 
328
335
  Building the candidate list, matching a query against it, ranking, deciding
@@ -835,7 +842,7 @@ Removing a worktree deletes its HEAD reflog and deleting a branch its
835
842
  reflog. `merged.reflog_only` lists the commits only those reach, by
836
843
  `rev-list --not --all`, and keeps each whose own patch-id the head lacks;
837
844
  they hold the row back until `--delete reflog`, which `--delete all`
838
- includes and which is the one value `--keep-branch` takes.
845
+ includes and which `--keep-branch` takes, as it takes `--delete stale-lock`.
839
846
 
840
847
  Patch-ids come from `git patch-id --verbatim`, Git 2.39 onward, which
841
848
  counts whitespace: a change that differs from a head commit only in
@@ -856,7 +863,12 @@ unmerged requests are never proof.
856
863
  `prune.removable()` selects only eligible rows. `main`, `master` and the
857
864
  head branch are protected. Locked or dirty worktrees, untracked files,
858
865
  initialized submodules and a submodule store left by `deinit` block removal;
859
- `git worktree remove` refuses each. A locked worktree whose directory is away
866
+ `git worktree remove` refuses each. A lock whose reason names a process
867
+ that has exited, `claude agent ID (pid N)` as a crashed Claude Code session
868
+ leaves it, is `stale-lock` instead, which `--delete stale-lock` lifts by
869
+ running `git worktree unlock` before the removal; every other lock names
870
+ the unlock for a person to run once they have checked it. The lock's reason
871
+ is pinned with the record. A locked worktree whose directory is away
860
872
  is assessed from its record. Empty branches and matching stashes require
861
873
  their own permission; ignored paths go with the worktree, listed in the
862
874
  disclosure first. `--yes` grants neither. A protection a value lifts ends
@@ -17,6 +17,20 @@ 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.14.0 - 2026-11-22
21
+
22
+ ### Added
23
+
24
+ `gw prune` and `gw remove` take `--delete stale-lock`, which unlocks and
25
+ removes a worktree whose lock names a process that has exited, as a
26
+ crashed Claude Code session leaves. Any other lock still blocks removal,
27
+ and its protection names the `git worktree unlock` to run by hand.
28
+
29
+ This repository is a plugin marketplace named `worktrees`, so the agent
30
+ plugin installs from it as `worktrees@worktrees`. That install follows
31
+ `main`, which can be ahead of the released CLI; `worktrees@mihaibojin`
32
+ from `MihaiBojin/agent-plugins` stays pinned to a release tag.
33
+
20
34
  ## 0.13.4 - 2026-11-22
21
35
 
22
36
  ### Fixed
@@ -0,0 +1,335 @@
1
+ Metadata-Version: 2.5
2
+ Name: git-worktrees
3
+ Version: 0.14.0
4
+ Summary: Git worktree commands that refuse to lose work.
5
+ Project-URL: Bug reports, https://github.com/MihaiBojin/worktrees/issues/new
6
+ Project-URL: Source, https://github.com/MihaiBojin/worktrees
7
+ Author-email: Mihai Bojin <557584+MihaiBojin@users.noreply.github.com>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: cli,git,worktree
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Natural Language :: English
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Requires-Python: >=3.11
21
+ Provides-Extra: dev
22
+ Requires-Dist: hatchling==1.28.0; extra == 'dev'
23
+ Requires-Dist: pre-commit==4.6.1; extra == 'dev'
24
+ Requires-Dist: pytest-xdist==3.8.0; extra == 'dev'
25
+ Requires-Dist: pytest==9.1.1; extra == 'dev'
26
+ Description-Content-Type: text/markdown
27
+
28
+ # worktrees
29
+
30
+ [![Tests](https://github.com/MihaiBojin/worktrees/actions/workflows/tests.yml/badge.svg)](https://github.com/MihaiBojin/worktrees/actions/workflows/tests.yml)
31
+ [![PyPI](https://img.shields.io/pypi/v/git-worktrees)](https://pypi.org/project/git-worktrees/)
32
+
33
+ `gw` creates Git worktrees and removes finished branches after checking for
34
+ unmerged work. It recognizes squash merges and lists ignored files before
35
+ deleting a checkout. The fish and zsh plugins let you switch worktrees
36
+ without typing paths.
37
+
38
+ ## Install
39
+
40
+ Install [uv](https://docs.astral.sh/uv/getting-started/installation/), then
41
+ install the commands:
42
+
43
+ ```console
44
+ uv tool install git-worktrees
45
+ ```
46
+
47
+ The package requires Python 3.11 or newer and has no Python runtime
48
+ dependencies. Use Git 2.39 or newer for squash-merge detection. Partial
49
+ clones have [additional Git version requirements](docs/REFERENCE.md#sync-cache).
50
+
51
+ The install provides `gw` and its long name, `worktrees`. If uv reports that
52
+ its executable directory is missing from `PATH`, run `uv tool update-shell`
53
+ and restart your shell. Upgrade the commands with `uv tool upgrade git-worktrees`.
54
+
55
+ The commands work from any shell. Install the matching fish or zsh plugin
56
+ for completions, shortcuts and directory changes. Pin the plugin to the
57
+ release that `gw version` reports; an unpinned plugin follows `main`, which
58
+ can contain unreleased changes.
59
+
60
+ ### fish
61
+
62
+ With [Fisher](https://github.com/jorgebucaran/fisher) installed, run:
63
+
64
+ ```fish
65
+ fisher install MihaiBojin/worktrees@v0.14.0
66
+ ```
67
+
68
+ To change release, edit the tag in `$__fish_config_dir/fish_plugins`, then
69
+ run `fisher update`. Use the same procedure to pin an untagged installation.
70
+
71
+ ### zsh
72
+
73
+ With [Antidote](https://antidote.sh/) installed, add this line to its plugin
74
+ list, normally `~/.zsh_plugins.txt`, and open a new shell:
75
+
76
+ ```text
77
+ MihaiBojin/worktrees branch:v0.14.0 path:zsh/plugins/worktrees
78
+ ```
79
+
80
+ Completion needs `compinit`. If your shell configuration does not run it,
81
+ add this after the plugin loads:
82
+
83
+ ```zsh
84
+ autoload -Uz compinit && compinit
85
+ ```
86
+
87
+ To change the tag, first remove Antidote's clone:
88
+
89
+ ```zsh
90
+ antidote purge MihaiBojin/worktrees
91
+ ```
92
+
93
+ Then edit the tag in the plugin list and open a new shell. Editing the list
94
+ after the purge makes Antidote rebuild its generated bundle.
95
+
96
+ ### Check the installation
97
+
98
+ Run `gw --help`. With matching command and shell releases, its output
99
+ includes:
100
+
101
+ ```console
102
+ worktrees 0.14.0: git worktree commands that refuse to lose work
103
+ The shell plugin here is 0.14.0, the same release as these commands.
104
+ ```
105
+
106
+ Upgrade the commands and the shell plugin together. For development from a
107
+ clone, see [Working on a checkout](docs/DEVELOPMENT.md#working-on-a-checkout).
108
+
109
+ ## Quickstart
110
+
111
+ Run commands inside the repository you want to manage. The repository must
112
+ have a commit and a resolvable [head branch](docs/REFERENCE.md#head-and-evidence),
113
+ usually the default remote's default branch, or local `main` or `master`.
114
+
115
+ Create a worktree on a new branch named `fix-parser`. This example works in
116
+ bash and zsh with or without the shell plugin:
117
+
118
+ ```sh
119
+ cd "$(command gw add fix-parser -q)"
120
+ git branch --show-current
121
+ ```
122
+
123
+ The second command prints:
124
+
125
+ ```text
126
+ fix-parser
127
+ ```
128
+
129
+ For a main checkout at `/path/to/repo`, the new checkout is at
130
+ `/path/to/.worktrees/fix-parser/repo`. With the fish or zsh plugin loaded,
131
+ `gw add fix-parser` creates the checkout and changes directory in one call.
132
+ If the branch already exists, `gw add` uses it; a branch that exists only
133
+ on the remote needs confirmation or `--yes`.
134
+
135
+ Use `gw list` to choose another worktree. Type to filter, use the arrow keys
136
+ to move, and press enter to select. `gw list fix-parser` selects a unique
137
+ match directly. Without a terminal, `gw list` prints metadata. The shell
138
+ plugin performs the directory change.
139
+
140
+ ## Commands
141
+
142
+ `gw --help` lists every command and shortcut. Each command's `--help`
143
+ describes its flags. The guides cover these tasks:
144
+
145
+ | Command | Task |
146
+ | --- | --- |
147
+ | [`gw add NAME [BASE]`](docs/commands/add.md) | Create a worktree for a new or existing branch |
148
+ | [`gw list [QUERY]`](docs/commands/list.md) | Choose a worktree or list matching checkouts |
149
+ | [`gw select-main`](docs/commands/list.md#select-main) | Go to the worktree on the head branch |
150
+ | [`gw sync`](#head-and-synchronization) | Refresh remote refs and GitHub or GitLab evidence |
151
+ | [`gw prune`](#assess-and-remove) | Assess worktrees and remove eligible ones after confirmation |
152
+ | [`gw remove [NAME\|PATH]`](#assess-and-remove) | Assess or remove one worktree |
153
+ | [`gw branch status [NAME ...]`](docs/commands/branch-status.md) | Assess branches without worktrees |
154
+ | [`gw branch prune [NAME ...]`](docs/commands/branch-prune.md) | Delete eligible branches without worktrees |
155
+ | [`gw branch create NAME`](docs/commands/branch-create.md) | Start a branch in the current checkout |
156
+ | [`gw fast-forward [NAME]`](docs/commands/fast-forward.md) | Update a branch, or continue from a finished branch on a new one |
157
+ | [`gw push`](docs/commands/push.md) | Push with checks for remote work and previously merged commits |
158
+ | [`gw ci-checks [NUMBER]`](docs/commands/ci-checks.md) | Read or wait for checks on a GitHub pull request or GitLab merge request |
159
+ | [`gw merge NUMBER...`](docs/commands/merge.md) | Squash checked GitHub pull requests, including native stacks |
160
+ | [`gw stack-link NUMBER NUMBER ...`](docs/commands/stack-link.md) | Link GitHub pull requests into a native stack |
161
+ | [`gw preflight`](docs/commands/preflight.md) | Check repository and plugin setup |
162
+ | `gw version` | Print the installed version |
163
+
164
+ A shortcut such as `gwa` is a shell function that calls `gw add`. Only `gw`
165
+ and `worktrees` are installed as executables.
166
+
167
+ ## Assess and remove
168
+
169
+ Preview worktree removal as JSON:
170
+
171
+ ```console
172
+ gw prune --json
173
+ ```
174
+
175
+ The `verdicts` array gives each worktree's `reason`, `eligible` status and
176
+ `protections`. Use `eligible` to decide whether removal is permitted.
177
+ `gw prune --table` prints the assessment as text. Neither preview removes
178
+ worktrees or branches; assessments can save proof caches and sync first.
179
+
180
+ WARNING: Copy any ignored files that you need before removal. Removing a
181
+ worktree deletes its ignored files, including virtual environments and
182
+ build output. Git cannot restore those files.
183
+
184
+ On a terminal, assess and confirm eligible removals with:
185
+
186
+ ```console
187
+ gw prune
188
+ ```
189
+
190
+ The command lists each checkout, ignored path and branch that it will
191
+ delete. It prints restore commands for branches and approved stashes.
192
+ Press `y` to confirm; any other key cancels. The command reassesses before
193
+ removal and refuses targets that changed.
194
+
195
+ `gw remove NAME` applies the same checks to one worktree. Use a quoted
196
+ absolute path when names are ambiguous. Without a terminal, or with
197
+ `--json` or `--table`, both commands assess only. `--yes` approves removal
198
+ but grants no additional deletion permission. Removing the current
199
+ worktree always needs a second terminal confirmation.
200
+
201
+ The main checkout and dirty worktrees stay. Untracked files, active
202
+ operations and submodule stores also block removal. The branches `main`,
203
+ `master` and the head branch cannot be deleted. Other protections require
204
+ explicit permission:
205
+
206
+ | Flag | Permits |
207
+ | --- | --- |
208
+ | `--delete empty` | An unused branch and its checkout |
209
+ | `--delete closed` | A branch whose request closed without merging its current tip |
210
+ | `--delete stashes` | Stashes associated with the branch |
211
+ | `--delete reflog` | Commits held only by reflogs that removal deletes |
212
+ | `--delete stale-lock` | Unlocking a worktree whose recorded process has exited |
213
+ | `--delete all` | All the categories above |
214
+
215
+ Repeat `--delete` to combine categories. `--keep-branch` retains the branch
216
+ and its stashes while removing an otherwise unprotected checkout. It
217
+ accepts only `--delete reflog` and `--delete stale-lock`; a detached
218
+ checkout still needs proof that its commits are finished.
219
+
220
+ See [protections and permissions](docs/REFERENCE.md#protections-and-permissions)
221
+ for the checks, and [deletion and recovery](docs/REFERENCE.md#deletion-and-recovery)
222
+ for partial failures and restore commands. Restore branches or stashes
223
+ before Git garbage collection removes their unreachable commits.
224
+
225
+ ### Shortcuts
226
+
227
+ The shell plugins provide these removal shortcuts:
228
+
229
+ | Shortcut | Runs |
230
+ | --- | --- |
231
+ | `gwp` | `gw prune` |
232
+ | `gwp!` | `gw prune --yes` |
233
+ | `gwpa` | `gw prune --delete all` |
234
+ | `gwpa!` | `gw prune --delete all --yes` |
235
+ | `gwr` | `gw remove` |
236
+ | `gwr!` | `gw remove --yes` |
237
+ | `gwrk!` | `gw remove --keep-branch --yes` |
238
+
239
+ ## Head and synchronization
240
+
241
+ `gw sync` fetches every remote and asks GitHub or GitLab about local branch
242
+ tips. GitHub needs an authenticated `gh`; GitLab needs an authenticated
243
+ `glab`. With several remotes, set Git's `checkout.defaultRemote` to select
244
+ the remote used for assessments.
245
+
246
+ Assessments sync first when the default remote has never synced or its
247
+ last sync is at least 300 seconds old. `WORKTREES_SYNC_TTL` changes that
248
+ interval in whole seconds. A failed sync warns and the assessment proceeds
249
+ with available evidence. `gw list` reads local worktree records without
250
+ syncing.
251
+
252
+ `gw fast-forward` fetches the default remote when sync is due and reads
253
+ fresh request evidence when needed. It can fetch again when a merged
254
+ request names a commit missing locally. `gw push` fetches on every run.
255
+ Both refuse when a required fetch or request query fails.
256
+
257
+ Set `WORKTREES_OFFLINE=1` to prevent network access. Local assessment and
258
+ navigation still work; commands that require the network refuse. See
259
+ [head and evidence](docs/REFERENCE.md#head-and-evidence) and
260
+ [sync cache](docs/REFERENCE.md#sync-cache) for fallback rules and partial
261
+ sync outcomes.
262
+
263
+ ## Output and JSON
264
+
265
+ Results go to stdout; diagnostics and prompts go to stderr. JSON results
266
+ are objects with `head` and `lastSync`. Worktree and branch assessments put
267
+ rows in `verdicts`; navigation puts rows in `worktrees`.
268
+
269
+ With [jq](https://jqlang.org/) installed, list paths or select eligible rows:
270
+
271
+ ```console
272
+ gw list --json | jq -r '.worktrees[].path'
273
+ gw prune --json | jq '.verdicts[] | select(.eligible)'
274
+ ```
275
+
276
+ The first command prints one path per worktree. The second prints eligible
277
+ assessment rows and removes nothing. JSON preserves paths as strings;
278
+ keep paths quoted when passing them to a command.
279
+
280
+ `--json` disables colour. `-q` suppresses summaries where supported, while
281
+ `-v` traces subprocesses on stderr. See [JSON and streams](docs/REFERENCE.md#json-and-streams)
282
+ for fields and the commands that accept each flag.
283
+
284
+ Commands append an [audit log](docs/REFERENCE.md#audit-log) under
285
+ `~/.local/state/worktrees`, or `$XDG_STATE_HOME/worktrees` when set.
286
+ `WORKTREES_AUDIT_DIR` changes the directory; `WORKTREES_AUDIT=off` disables
287
+ logging. Help and completion record nothing.
288
+
289
+ ## What it refuses
290
+
291
+ The CLI refuses these Git operations regardless of command flags:
292
+
293
+ ```
294
+ reset --hard
295
+ a forced checkout or switch
296
+ clean -f
297
+ push --force
298
+ worktree remove --force
299
+ branch -D
300
+ an update-ref delete that names no full sha
301
+ a forced fetch into a local ref
302
+ ```
303
+
304
+ `gw --explain` lists the Git commands that the CLI can run and the guard
305
+ rules that apply to them.
306
+
307
+ ## Agent plugin
308
+
309
+ The [agent plugin](plugin/README.md) provides six skills for Claude Code
310
+ and Codex. They update branches through conflicts, inspect checks, maintain
311
+ pull request descriptions, ship changes through merge, prune approved
312
+ worktrees and configure permissions.
313
+
314
+ Install the plugin from the `mihaibojin` marketplace as its README
315
+ describes, then run `gw preflight` inside each repository. The
316
+ [preflight guide](docs/commands/preflight.md) explains each check and how
317
+ to install the current client's permission rules. The skills use the
318
+ checkout assigned to the session.
319
+
320
+ ## Migration
321
+
322
+ See the [migration table](docs/REFERENCE.md#migration) for renamed commands
323
+ and flags. Scripts that act on assessments must check `eligible` before
324
+ removal; a `remove` verdict alone does not grant permission.
325
+
326
+ ## Contributing
327
+
328
+ [DEVELOPMENT.md](docs/DEVELOPMENT.md) lists the setup and checks for a
329
+ contribution. Report bugs through [GitHub issues](https://github.com/MihaiBojin/worktrees/issues).
330
+ The [reference](docs/REFERENCE.md) documents shared rules and links to
331
+ every command guide.
332
+
333
+ ## Licence
334
+
335
+ Apache-2.0, Mihai Bojin. See [LICENSE](LICENSE).