git-worktrees 0.13.4__tar.gz → 0.15.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 (166) hide show
  1. git_worktrees-0.15.0/.agents/plugins/marketplace.json +20 -0
  2. git_worktrees-0.15.0/.claude-plugin/marketplace.json +15 -0
  3. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/.github/workflows/publish.yml +34 -13
  4. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/.releasetools.yaml +6 -3
  5. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/AGENTS.md +36 -8
  6. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/CHANGELOG.md +42 -0
  7. git_worktrees-0.15.0/PKG-INFO +341 -0
  8. git_worktrees-0.15.0/README.md +314 -0
  9. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/completions/gw.fish +9 -2
  10. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/conf.d/worktrees.fish +1 -1
  11. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/docs/DEVELOPMENT.md +20 -13
  12. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/docs/REFERENCE.md +103 -9
  13. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/docs/commands/push.md +77 -6
  14. git_worktrees-0.15.0/docs/commands/update.md +30 -0
  15. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/.claude-plugin/plugin.json +1 -1
  16. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/.codex-plugin/plugin.json +1 -1
  17. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/README.md +31 -3
  18. git_worktrees-0.15.0/plugin/evals/ship-it-release/graders/actions.md +19 -0
  19. git_worktrees-0.15.0/plugin/evals/ship-it-release/prompt.md +29 -0
  20. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/plugin.json +1 -1
  21. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/skills/describe-pr/SKILL.md +2 -2
  22. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/skills/describe-pr/format.md +3 -1
  23. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/skills/preflight/rules.json +2 -0
  24. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/skills/preflight/worktrees.rules +10 -0
  25. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/skills/prune/SKILL.md +9 -4
  26. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/skills/ship-it/SKILL.md +156 -21
  27. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/skills/ship-it/rights.md +26 -1
  28. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/pyproject.toml +1 -1
  29. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/cli.py +88 -19
  30. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/fast_forward.py +3 -2
  31. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/git.py +2 -0
  32. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/prune.py +8 -1
  33. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/push.py +157 -10
  34. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/repo.py +60 -6
  35. git_worktrees-0.15.0/src/worktrees/update.py +226 -0
  36. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/verdicts.py +77 -13
  37. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/worktree.py +7 -1
  38. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/audit_schema.py +19 -0
  39. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_assessment.py +110 -1
  40. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_audit.py +38 -0
  41. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_branches.py +6 -3
  42. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_completions.py +37 -12
  43. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_fast_forward.py +10 -1
  44. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_gates.py +3 -2
  45. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_plugin.py +146 -4
  46. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_push.py +69 -0
  47. git_worktrees-0.15.0/tests/test_push_tag.py +372 -0
  48. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_shims.py +20 -2
  49. git_worktrees-0.15.0/tests/test_update.py +308 -0
  50. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/uv.lock +2 -2
  51. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/completions/_gw +13 -2
  52. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/worktrees.plugin.zsh +4 -2
  53. git_worktrees-0.13.4/PKG-INFO +0 -762
  54. git_worktrees-0.13.4/README.md +0 -735
  55. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/.claude/settings.json +0 -0
  56. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/.codex/config.toml +0 -0
  57. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/.github/workflows/codeql.yml +0 -0
  58. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/.github/workflows/testpypi.yml +0 -0
  59. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/.github/workflows/tests.yml +0 -0
  60. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/.gitignore +0 -0
  61. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/.pre-commit-config.yaml +0 -0
  62. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/.python-version +0 -0
  63. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/LICENSE +0 -0
  64. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/Makefile +0 -0
  65. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/completions/worktrees.fish +0 -0
  66. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/docs/BENCHMARK.md +0 -0
  67. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/docs/commands/add.md +0 -0
  68. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/docs/commands/branch-create.md +0 -0
  69. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/docs/commands/branch-prune.md +0 -0
  70. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/docs/commands/branch-status.md +0 -0
  71. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/docs/commands/ci-checks.md +0 -0
  72. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/docs/commands/fast-forward.md +0 -0
  73. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/docs/commands/list.md +0 -0
  74. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/docs/commands/merge.md +0 -0
  75. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/docs/commands/preflight.md +0 -0
  76. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/docs/commands/stack-link.md +0 -0
  77. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/docs/plans/2026-11-05-worktree-pruning-design.md +0 -0
  78. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gw.fish +0 -0
  79. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gwa.fish +0 -0
  80. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gwbc.fish +0 -0
  81. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gwbp.fish +0 -0
  82. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gwbs.fish +0 -0
  83. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gwff.fish +0 -0
  84. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gwl.fish +0 -0
  85. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gwm.fish +0 -0
  86. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gwp!.fish +0 -0
  87. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gwp.fish +0 -0
  88. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gwpa!.fish +0 -0
  89. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gwpa.fish +0 -0
  90. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gwpu.fish +0 -0
  91. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gwr!.fish +0 -0
  92. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gwr.fish +0 -0
  93. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gwrk!.fish +0 -0
  94. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/functions/gws.fish +0 -0
  95. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/hatch_build.py +0 -0
  96. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/hooks/codex.json +0 -0
  97. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/hooks/hooks.json +0 -0
  98. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/session.md +0 -0
  99. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/skills/ci-checks/SKILL.md +0 -0
  100. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/skills/fast-forward/SKILL.md +0 -0
  101. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/skills/preflight/SKILL.md +0 -0
  102. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/skills/preflight/agents/openai.yaml +0 -0
  103. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/skills/preflight/config.toml +0 -0
  104. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/skills/preflight/merge_codex_rules.py +0 -0
  105. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/plugin/skills/preflight/project.json +0 -0
  106. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/renovate.json +0 -0
  107. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/scripts/README.md +0 -0
  108. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/scripts/benchmark.py +0 -0
  109. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/scripts/bump_version.py +0 -0
  110. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/scripts/verify-publish.bash +0 -0
  111. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/__init__.py +0 -0
  112. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/audit.py +0 -0
  113. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/branch_cli.py +0 -0
  114. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/branch_forge.py +0 -0
  115. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/branches.py +0 -0
  116. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/ci.py +0 -0
  117. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/errors.py +0 -0
  118. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/forge.py +0 -0
  119. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/layout.py +0 -0
  120. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/merged.py +0 -0
  121. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/new_branch.py +0 -0
  122. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/pick.py +0 -0
  123. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/pr_merge.py +0 -0
  124. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/preflight.py +0 -0
  125. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/progress.py +0 -0
  126. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/render.py +0 -0
  127. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/stack_link.py +0 -0
  128. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/src/worktrees/sync.py +0 -0
  129. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/conftest.py +0 -0
  130. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_benchmark.py +0 -0
  131. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_branch_forge.py +0 -0
  132. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_ci.py +0 -0
  133. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_cli.py +0 -0
  134. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_command_defaults.py +0 -0
  135. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_fixture.py +0 -0
  136. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_forge.py +0 -0
  137. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_git_records.py +0 -0
  138. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_new_branch.py +0 -0
  139. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_partial_clone.py +0 -0
  140. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_path_boundaries.py +0 -0
  141. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_pr_merge.py +0 -0
  142. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_preflight.py +0 -0
  143. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_removal.py +0 -0
  144. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_render.py +0 -0
  145. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_spec.py +0 -0
  146. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_stack_link.py +0 -0
  147. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_sync.py +0 -0
  148. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_version.py +0 -0
  149. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/tests/test_worktree.py +0 -0
  150. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gw +0 -0
  151. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gwa +0 -0
  152. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gwbc +0 -0
  153. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gwbp +0 -0
  154. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gwbs +0 -0
  155. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gwff +0 -0
  156. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gwl +0 -0
  157. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gwm +0 -0
  158. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gwp +0 -0
  159. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gwp! +0 -0
  160. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gwpa +0 -0
  161. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gwpa! +0 -0
  162. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gwpu +0 -0
  163. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gwr +0 -0
  164. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gwr! +0 -0
  165. {git_worktrees-0.13.4 → git_worktrees-0.15.0}/zsh/plugins/worktrees/functions/gwrk! +0 -0
  166. {git_worktrees-0.13.4 → git_worktrees-0.15.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
+ }
@@ -1,5 +1,5 @@
1
1
  name: Publish
2
- run-name: Release ${{ inputs.version && format('v{0}', inputs.version) || github.ref_name }}
2
+ run-name: Release ${{ inputs.version && format('v{0} at {1}', inputs.version, inputs.commit) || github.ref_name }}
3
3
 
4
4
  # Renaming this file breaks publishing. PyPI's Trusted Publishing matches a
5
5
  # request against the repository, this workflow's FILENAME and the environment,
@@ -8,13 +8,9 @@ run-name: Release ${{ inputs.version && format('v{0}', inputs.version) || github
8
8
  # build -> tag -> publish -> release -> list
9
9
  # \-> verify
10
10
  #
11
- # A release is a version bump merged into main, then published one of two
12
- # ways, as .releasetools.yaml's release.trigger lists them. Pushing the signed
13
- # tag v<version> on the release commit starts this workflow. Or a dispatch
14
- # names the version and the release commit, and the tag job creates the tag
15
- # once build has passed, before anything is uploaded. Either way the
16
- # irreversible step is the last one and everything before it is a normal
17
- # reviewed change.
11
+ # The configured release dispatch names the version and its merge commit.
12
+ # The tag job creates the tag after build passes. A pushed version tag also
13
+ # starts this workflow.
18
14
  #
19
15
  # There is no TestPyPI rehearsal. testpypi.yml publishes every commit on main
20
16
  # there as <version>.post<epoch> and installs it back, so the tree this tag
@@ -402,7 +398,7 @@ jobs:
402
398
 
403
399
  # signed-push commits onto a branch that exists, so the branch starts at
404
400
  # 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.
401
+ # it goes on to the merge, and without one a person decides.
406
402
  - name: Create the branch
407
403
  id: branch
408
404
  if: steps.bump.outputs.changed == 'true'
@@ -418,6 +414,7 @@ jobs:
418
414
  if [ -n "$open" ]; then
419
415
  echo "$branch already has a pull request: $open" >&2
420
416
  echo "action=none" >>"$GITHUB_OUTPUT"
417
+ echo "pr=$open" >>"$GITHUB_OUTPUT"
421
418
  exit 0
422
419
  fi
423
420
  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 +440,9 @@ jobs:
443
440
  prune: "false"
444
441
  token: ${{ steps.app-token.outputs.token }}
445
442
 
446
- # Opened as the App, so the marketplace's own checks run on it. Merging
447
- # is left to a person.
443
+ # Opened as the App, so the marketplace's own checks run on it.
448
444
  - name: Open the pull request
445
+ id: open
449
446
  if: steps.branch.outputs.action == 'commit'
450
447
  env:
451
448
  GH_TOKEN: ${{ steps.app-token.outputs.token }}
@@ -455,5 +452,29 @@ jobs:
455
452
  body="$(printf '%s\n\n%s\n' \
456
453
  "The \`worktrees\` listing installs the plugin from its $TAG tag." \
457
454
  "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"
455
+ url="$(gh pr create --repo "$MARKETPLACE" --base main --head "$BRANCH" \
456
+ --title "chore(worktrees): List $TAG" --body "$body")"
457
+ echo "$url"
458
+ echo "pr=$url" >>"$GITHUB_OUTPUT"
459
+
460
+ # The marketplace's main requires no checks, so the job waits for them
461
+ # itself. They register a few seconds after the pull request opens, and
462
+ # `gh pr checks` reports none until then. A failed check, or none after
463
+ # five minutes, fails the job and leaves the pull request to a person.
464
+ # The squash is pinned to the head the checks ran on.
465
+ - name: Merge the pull request once its checks pass
466
+ if: steps.open.outputs.pr != '' || steps.branch.outputs.pr != ''
467
+ timeout-minutes: 30
468
+ env:
469
+ GH_TOKEN: ${{ steps.app-token.outputs.token }}
470
+ PR: ${{ steps.open.outputs.pr || steps.branch.outputs.pr }}
471
+ run: |
472
+ set -euo pipefail
473
+ head="$(gh pr view "$PR" --json headRefOid --jq .headRefOid)"
474
+ for _ in $(seq 60); do
475
+ count="$(gh pr checks "$PR" --json name --jq length 2>/dev/null || true)"
476
+ if [ -n "$count" ] && [ "$count" != 0 ]; then break; fi
477
+ sleep 5
478
+ done
479
+ gh pr checks "$PR" --watch --fail-fast --interval 10
480
+ gh pr merge "$PR" --squash --match-head-commit "$head"
@@ -22,7 +22,10 @@ release:
22
22
  merge: squash
23
23
  checks: tests.yml
24
24
  publish: publish.yml
25
- # A pushed signed tag starts publish.yml, or a dispatch with the version
26
- # and the release commit does and publish.yml creates the tag.
27
- trigger: [tag, dispatch]
25
+ # The dispatch names the release commit. publish.yml creates its tag.
26
+ trigger: dispatch
27
+ tagging: workflow
28
28
  registry: https://pypi.org/pypi/git-worktrees/{version}/json
29
+
30
+ conventions:
31
+ except: [tag-version-to-release]
@@ -169,8 +169,13 @@ leaves it in progress, at exit 1 with the stopped commit and files in
169
169
  only fast-forwards.
170
170
  [fast-forward](docs/commands/fast-forward.md) gives the order of the checks.
171
171
 
172
- `gw push` fetches the default remote on every run and pushes the branch
173
- checked out: `--set-upstream` when the remote lacks it, otherwise
172
+ `gw update` merges the fetched review target into a clean branch. It records the
173
+ merge it started so `--continue` can finish it after a conflict. The head branch
174
+ uses `gw fast-forward`. [Update](docs/commands/update.md) describes the refusals.
175
+
176
+ `gw push --ff-only` fetches and requires the remote tip to be an ancestor
177
+ of the branch, then makes a normal push. The default `gw push` fetches the
178
+ default remote on every run and pushes the branch checked out: `--set-upstream` when the remote lacks it, otherwise
174
179
  `--force-with-lease=refs/heads/BRANCH:SHA` on the sha the fetch read.
175
180
  Two checks come first. `push.only_there` lists the remote copy's commits
176
181
  that neither the branch nor the head ref holds by sha or patch-id, outside
@@ -185,6 +190,14 @@ refusal nothing lifts, and names `gw fast-forward`. `--force-if-includes` is not
185
190
  ignores it beside an explicit lease, and the first check asks what it
186
191
  would. [Push](docs/commands/push.md) has the outputs.
187
192
 
193
+ `gw push --tag NAME` calls `push.push_tag` without the branch checks or a fetch.
194
+ It captures the raw local tag object and pins the default remote's single push
195
+ URL for both inspection and publication. Mirror remotes are refused. An identical
196
+ remote object succeeds without pushing; a different object is refused. The push
197
+ uses the captured object ID as its source and verifies the remote tag afterwards.
198
+ `--no-follow-tags` and `--recurse-submodules=no` limit publication to that tag.
199
+ `--tag` is mutually exclusive with `--replace` and `--ff-only`.
200
+
188
201
  ## Where shell code goes
189
202
 
190
203
  Fisher copies `functions/`, `completions/` and `conf.d/` from the repository
@@ -249,13 +262,13 @@ assumes a plugin root or a checkout at a known path.
249
262
  | `ci-checks` | `gw ci-checks --json`, `--wait` to wait without polling |
250
263
  | `describe-pr` | checks a review's title and body against its diff, and edits them |
251
264
  | `prune` | `gw prune --json` and `gw branch status --json`, then the removals approved |
252
- | `ship-it` | commits, `fast-forward`, `gw push`, `gh pr create`, `gw stack-link` for a stacked branch on GitHub, `describe-pr`, `ci-checks`, fixes on the branch, `gw merge` on GitHub or `glab mr merge` on GitLab, then `fast-forward` in the head branch's checkout, unassisted, for this checkout or each branch it is named; given numbers, those open reviews from `ci-checks` on |
265
+ | `ship-it` | ships branches or numbered reviews through CI and merge, then syncs the head checkout. `--update=merge` selects `gw update` and `gw push --ff-only`. Repositories with `release.tagging: after-merge` use the installed `release:tag` for exact version tags on confirmed merge SHAs. |
253
266
  | `preflight` | `gw preflight --json`, then, after asking, installs the current client's permission rules at user or project scope; project scope also writes the plugin setup in `.claude/settings.json` and `.codex/config.toml` |
254
267
 
255
268
  `describe-pr` and `ship-it` share `describe-pr/format.md`: the
256
269
  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
258
- `pr-description` skill, both write the title and the body in that skill's
270
+ of rules writes both. When the agent has the technical-writer plugin's
271
+ `write-pr-description` skill, both write the title and the body in that skill's
259
272
  format, and `format.md` keeps what to preserve, the auto-resolution block
260
273
  and the four ways a description is wrong. `tests/test_plugin.py` holds every skill's
261
274
  `allowed-tools` to reads, `gw sync` and `gw branch create`: no pattern
@@ -286,6 +299,9 @@ skill's commands to never writing `--force`, `--admin`, `--auto`,
286
299
  push forms in `preflight/rules.json` and `gh api` calls that name a merge;
287
300
  Codex denies every direct `git push` and `gh api` command, regardless of
288
301
  trailing arguments.
302
+ The release plugin's explicit preflight supplies its own installed-path publisher
303
+ permission. Worktrees grants no general Node permission. `--hold-merge` holds
304
+ publication, and a tag failure preserves the review number and merge SHA for retry.
289
305
  `rights.md` names the limits of prefix rules. A Claude Code deny rule
290
306
  matches past a leading assignment, so the conflict loop
291
307
  continues a rebase with `gw fast-forward --continue`.
@@ -323,6 +339,13 @@ The plugin carries the release version in three manifests, and
323
339
  portable manifest, the Claude one with only the fields Agent Plugins v1 names;
324
340
  the same test holds it to that.
325
341
 
342
+ The repository root is a marketplace named `worktrees`, one catalog a
343
+ client, whose one entry is `./plugin`: `worktrees@worktrees`. Neither
344
+ catalog names a version or a tag, so a release stamps nothing there, and
345
+ `tests/test_plugin.py` holds both to that. `MihaiBojin/agent-plugins` lists
346
+ the same plugin as `worktrees@mihaibojin`, pinned to a release tag that the
347
+ `list` job in `publish.yml` moves; preflight sets up that one.
348
+
326
349
  ## The picker is Python's, and there is no fzf
327
350
 
328
351
  Building the candidate list, matching a query against it, ranking, deciding
@@ -535,7 +558,7 @@ when eight threads are asking at once.
535
558
  default first, updates the default remote's HEAD and queries the forge for
536
559
  every local branch tip on eight threads. Every other command but
537
560
  `gw version`, `gw list`, `gw ci-checks`, `gw merge`, `gw stack-link`,
538
- `gw preflight`, `gw fast-forward`, `gw push`, help and completion runs the
561
+ `gw preflight`, `gw fast-forward`, `gw update`, `gw push`, help and completion runs the
539
562
  same `sync.run` first when
540
563
  `sync.due` says so: the default remote's refs time is null or at least
541
564
  `WORKTREES_SYNC_TTL` seconds old, 300 by default. The forge time is not read,
@@ -835,7 +858,7 @@ Removing a worktree deletes its HEAD reflog and deleting a branch its
835
858
  reflog. `merged.reflog_only` lists the commits only those reach, by
836
859
  `rev-list --not --all`, and keeps each whose own patch-id the head lacks;
837
860
  they hold the row back until `--delete reflog`, which `--delete all`
838
- includes and which is the one value `--keep-branch` takes.
861
+ includes and which `--keep-branch` takes, as it takes `--delete stale-lock`.
839
862
 
840
863
  Patch-ids come from `git patch-id --verbatim`, Git 2.39 onward, which
841
864
  counts whitespace: a change that differs from a head commit only in
@@ -856,7 +879,12 @@ unmerged requests are never proof.
856
879
  `prune.removable()` selects only eligible rows. `main`, `master` and the
857
880
  head branch are protected. Locked or dirty worktrees, untracked files,
858
881
  initialized submodules and a submodule store left by `deinit` block removal;
859
- `git worktree remove` refuses each. A locked worktree whose directory is away
882
+ `git worktree remove` refuses each. A lock whose reason names a process
883
+ that has exited, `claude agent ID (pid N)` as a crashed Claude Code session
884
+ leaves it, is `stale-lock` instead, which `--delete stale-lock` lifts by
885
+ running `git worktree unlock` before the removal; every other lock names
886
+ the unlock for a person to run once they have checked it. The lock's reason
887
+ is pinned with the record. A locked worktree whose directory is away
860
888
  is assessed from its record. Empty branches and matching stashes require
861
889
  their own permission; ignored paths go with the worktree, listed in the
862
890
  disclosure first. `--yes` grants neither. A protection a value lifts ends
@@ -17,6 +17,48 @@ 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.15.0 - 2026-11-30
21
+
22
+ ### Added
23
+
24
+ `gw push --tag NAME` publishes one existing local tag to the default remote, including prefixed tags. It preserves annotations and signatures, refuses conflicting remote tags, and verifies publication. Tag publication requires Git 2.46 or newer.
25
+
26
+ `gw update` merges the fetched review target into the current branch.
27
+ `ship-it --update=merge` uses it with `gw push --ff-only` to preserve branch commits.
28
+
29
+ `ship-it` publishes exact signed version tags for confirmed merges in repositories that opt into `after-merge`. A resumed publication uses the original merge commits.
30
+
31
+ ### Changed
32
+
33
+ The `ship-it` skill runs branch and worktree cleanup only when requested.
34
+
35
+ ### Fixed
36
+
37
+ Branch pushes leave annotated tags local even when Git enables `push.followTags`.
38
+
39
+ The zsh plugin loads its functions at startup, so `gw` works in Claude Code's copied shells without `fpath`. `ship-it` calls `gw fast-forward` in its final step, matching the configured permission rule.
40
+
41
+ `describe-pr` and `ship-it` load technical-writer's `write-pr-description`
42
+ skill when it is installed, and write the pull request's title and body in
43
+ its format.
44
+
45
+ `describe-pr` and `ship-it` keep the title and body of a release pull
46
+ request, titled `Release <version>`, exactly as written.
47
+
48
+ ## 0.14.0 - 2026-11-22
49
+
50
+ ### Added
51
+
52
+ `gw prune` and `gw remove` take `--delete stale-lock`, which unlocks and
53
+ removes a worktree whose lock names a process that has exited, as a
54
+ crashed Claude Code session leaves. Any other lock still blocks removal,
55
+ and its protection names the `git worktree unlock` to run by hand.
56
+
57
+ This repository is a plugin marketplace named `worktrees`, so the agent
58
+ plugin installs from it as `worktrees@worktrees`. That install follows
59
+ `main`, which can be ahead of the released CLI; `worktrees@mihaibojin`
60
+ from `MihaiBojin/agent-plugins` stays pinned to a release tag.
61
+
20
62
  ## 0.13.4 - 2026-11-22
21
63
 
22
64
  ### Fixed
@@ -0,0 +1,341 @@
1
+ Metadata-Version: 2.5
2
+ Name: git-worktrees
3
+ Version: 0.15.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.15.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.15.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.15.0: git worktree commands that refuse to lose work
103
+ The shell plugin here is 0.15.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 update`](docs/commands/update.md) | Merge the fetched review target into a clean branch |
158
+ | [`gw push [--tag NAME]`](docs/commands/push.md) | Push a checked branch or publish one existing tag |
159
+ | [`gw ci-checks [NUMBER]`](docs/commands/ci-checks.md) | Read or wait for checks on a GitHub pull request or GitLab merge request |
160
+ | [`gw merge NUMBER...`](docs/commands/merge.md) | Squash checked GitHub pull requests, including native stacks |
161
+ | [`gw stack-link NUMBER NUMBER ...`](docs/commands/stack-link.md) | Link GitHub pull requests into a native stack |
162
+ | [`gw preflight`](docs/commands/preflight.md) | Check repository and plugin setup |
163
+ | `gw version` | Print the installed version |
164
+
165
+ A shortcut such as `gwa` is a shell function that calls `gw add`. Only `gw`
166
+ and `worktrees` are installed as executables.
167
+
168
+ ## Assess and remove
169
+
170
+ Preview worktree removal as JSON:
171
+
172
+ ```console
173
+ gw prune --json
174
+ ```
175
+
176
+ The `verdicts` array gives each worktree's `reason`, `eligible` status and
177
+ `protections`. Use `eligible` to decide whether removal is permitted.
178
+ `gw prune --table` prints the assessment as text. Neither preview removes
179
+ worktrees or branches; assessments can save proof caches and sync first.
180
+
181
+ WARNING: Copy any ignored files that you need before removal. Removing a
182
+ worktree deletes its ignored files, including virtual environments and
183
+ build output. Git cannot restore those files.
184
+
185
+ On a terminal, assess and confirm eligible removals with:
186
+
187
+ ```console
188
+ gw prune
189
+ ```
190
+
191
+ The command lists each checkout, ignored path and branch that it will
192
+ delete. It prints restore commands for branches and approved stashes.
193
+ Press `y` to confirm; any other key cancels. The command reassesses before
194
+ removal and refuses targets that changed.
195
+
196
+ `gw remove NAME` applies the same checks to one worktree. Use a quoted
197
+ absolute path when names are ambiguous. Without a terminal, or with
198
+ `--json` or `--table`, both commands assess only. `--yes` approves removal
199
+ but grants no additional deletion permission. Removing the current
200
+ worktree always needs a second terminal confirmation.
201
+
202
+ The main checkout and dirty worktrees stay. Untracked files, active
203
+ operations and submodule stores also block removal. The branches `main`,
204
+ `master` and the head branch cannot be deleted. Other protections require
205
+ explicit permission:
206
+
207
+ | Flag | Permits |
208
+ | --- | --- |
209
+ | `--delete empty` | An unused branch and its checkout |
210
+ | `--delete closed` | A branch whose request closed without merging its current tip |
211
+ | `--delete stashes` | Stashes associated with the branch |
212
+ | `--delete reflog` | Commits held only by reflogs that removal deletes |
213
+ | `--delete stale-lock` | Unlocking a worktree whose recorded process has exited |
214
+ | `--delete all` | All the categories above |
215
+
216
+ Repeat `--delete` to combine categories. `--keep-branch` retains the branch
217
+ and its stashes while removing an otherwise unprotected checkout. It
218
+ accepts only `--delete reflog` and `--delete stale-lock`; a detached
219
+ checkout still needs proof that its commits are finished.
220
+
221
+ See [protections and permissions](docs/REFERENCE.md#protections-and-permissions)
222
+ for the checks, and [deletion and recovery](docs/REFERENCE.md#deletion-and-recovery)
223
+ for partial failures and restore commands. Restore branches or stashes
224
+ before Git garbage collection removes their unreachable commits.
225
+
226
+ ### Shortcuts
227
+
228
+ The shell plugins provide these removal shortcuts:
229
+
230
+ | Shortcut | Runs |
231
+ | --- | --- |
232
+ | `gwp` | `gw prune` |
233
+ | `gwp!` | `gw prune --yes` |
234
+ | `gwpa` | `gw prune --delete all` |
235
+ | `gwpa!` | `gw prune --delete all --yes` |
236
+ | `gwr` | `gw remove` |
237
+ | `gwr!` | `gw remove --yes` |
238
+ | `gwrk!` | `gw remove --keep-branch --yes` |
239
+
240
+ ## Head and synchronization
241
+
242
+ `gw sync` fetches every remote and asks GitHub or GitLab about local branch
243
+ tips. GitHub needs an authenticated `gh`; GitLab needs an authenticated
244
+ `glab`. With several remotes, set Git's `checkout.defaultRemote` to select
245
+ the remote used for assessments.
246
+
247
+ Assessments sync first when the default remote has never synced or its
248
+ last sync is at least 300 seconds old. `WORKTREES_SYNC_TTL` changes that
249
+ interval in whole seconds. A failed sync warns and the assessment proceeds
250
+ with available evidence. `gw list` reads local worktree records without
251
+ syncing.
252
+
253
+ `gw fast-forward` fetches the default remote when sync is due and reads
254
+ fresh request evidence when needed. It can fetch again when a merged
255
+ request names a commit missing locally. Branch pushes fetch on every run.
256
+ Both refuse when a required fetch or request query fails.
257
+ `gw push --tag release/v1.2.3` reads the exact tag at the push destination
258
+ and publishes the local tag when absent. It refuses a different remote object.
259
+ Tag publication reads remote refs without fetching them.
260
+
261
+ Set `WORKTREES_OFFLINE=1` to prevent network access. Local assessment and
262
+ navigation still work; commands that require the network refuse. See
263
+ [head and evidence](docs/REFERENCE.md#head-and-evidence) and
264
+ [sync cache](docs/REFERENCE.md#sync-cache) for fallback rules and partial
265
+ sync outcomes.
266
+
267
+ ## Output and JSON
268
+
269
+ Results go to stdout; diagnostics and prompts go to stderr. JSON results
270
+ are objects with `head` and `lastSync`. Worktree and branch assessments put
271
+ rows in `verdicts`; navigation puts rows in `worktrees`.
272
+
273
+ With [jq](https://jqlang.org/) installed, list paths or select eligible rows:
274
+
275
+ ```console
276
+ gw list --json | jq -r '.worktrees[].path'
277
+ gw prune --json | jq '.verdicts[] | select(.eligible)'
278
+ ```
279
+
280
+ The first command prints one path per worktree. The second prints eligible
281
+ assessment rows and removes nothing. JSON preserves paths as strings;
282
+ keep paths quoted when passing them to a command.
283
+
284
+ `--json` disables colour. `-q` suppresses summaries where supported, while
285
+ `-v` traces subprocesses on stderr. See [JSON and streams](docs/REFERENCE.md#json-and-streams)
286
+ for fields and the commands that accept each flag.
287
+
288
+ Commands append an [audit log](docs/REFERENCE.md#audit-log) under
289
+ `~/.local/state/worktrees`, or `$XDG_STATE_HOME/worktrees` when set.
290
+ `WORKTREES_AUDIT_DIR` changes the directory; `WORKTREES_AUDIT=off` disables
291
+ logging. Help and completion record nothing.
292
+
293
+ ## What it refuses
294
+
295
+ The CLI refuses these Git operations regardless of command flags:
296
+
297
+ ```
298
+ reset --hard
299
+ a forced checkout or switch
300
+ clean -f
301
+ push --force
302
+ worktree remove --force
303
+ branch -D
304
+ an update-ref delete that names no full sha
305
+ a forced fetch into a local ref
306
+ ```
307
+
308
+ `gw --explain` lists the Git commands that the CLI can run and the guard
309
+ rules that apply to them.
310
+
311
+ ## Agent plugin
312
+
313
+ The [agent plugin](plugin/README.md) provides six skills for Claude Code
314
+ and Codex. They update branches through conflicts, inspect checks, maintain
315
+ pull request descriptions, ship changes through merge, prune approved
316
+ worktrees and configure permissions. In repositories that opt into
317
+ `after-merge`, shipping includes the exact signed tags for version changes
318
+ in confirmed merges. See the [shipping guide](plugin/README.md#ship-it).
319
+
320
+ Install the plugin from the `mihaibojin` marketplace as its README
321
+ describes, then run `gw preflight` inside each repository. The
322
+ [preflight guide](docs/commands/preflight.md) explains each check and how
323
+ to install the current client's permission rules. The skills use the
324
+ checkout assigned to the session.
325
+
326
+ ## Migration
327
+
328
+ See the [migration table](docs/REFERENCE.md#migration) for renamed commands
329
+ and flags. Scripts that act on assessments must check `eligible` before
330
+ removal; a `remove` verdict alone does not grant permission.
331
+
332
+ ## Contributing
333
+
334
+ [DEVELOPMENT.md](docs/DEVELOPMENT.md) lists the setup and checks for a
335
+ contribution. Report bugs through [GitHub issues](https://github.com/MihaiBojin/worktrees/issues).
336
+ The [reference](docs/REFERENCE.md) documents shared rules and links to
337
+ every command guide.
338
+
339
+ ## Licence
340
+
341
+ Apache-2.0, Mihai Bojin. See [LICENSE](LICENSE).