git-worktrees 0.12.0__tar.gz → 0.12.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/.github/workflows/publish.yml +147 -3
  2. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/AGENTS.md +12 -0
  3. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/CHANGELOG.md +12 -0
  4. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/PKG-INFO +9 -5
  5. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/README.md +8 -4
  6. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/conf.d/worktrees.fish +1 -1
  7. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/docs/DEVELOPMENT.md +35 -2
  8. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/.claude-plugin/plugin.json +1 -1
  9. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/.codex-plugin/plugin.json +1 -1
  10. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/plugin.json +1 -1
  11. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/pyproject.toml +1 -1
  12. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/cli.py +1 -1
  13. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/prune.py +18 -4
  14. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/worktree.py +67 -15
  15. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_removal.py +25 -0
  16. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/uv.lock +1 -1
  17. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/worktrees.plugin.zsh +1 -1
  18. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/.claude/settings.json +0 -0
  19. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/.codex/config.toml +0 -0
  20. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/.github/workflows/codeql.yml +0 -0
  21. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/.github/workflows/testpypi.yml +0 -0
  22. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/.github/workflows/tests.yml +0 -0
  23. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/.gitignore +0 -0
  24. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/.pre-commit-config.yaml +0 -0
  25. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/.python-version +0 -0
  26. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/.releasetools.yaml +0 -0
  27. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/LICENSE +0 -0
  28. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/Makefile +0 -0
  29. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/completions/gw.fish +0 -0
  30. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/completions/worktrees.fish +0 -0
  31. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/docs/BENCHMARK.md +0 -0
  32. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/docs/REFERENCE.md +0 -0
  33. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/docs/commands/branch-prune.md +0 -0
  34. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/docs/commands/branch-status.md +0 -0
  35. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/docs/commands/ci-checks.md +0 -0
  36. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/docs/commands/fast-forward.md +0 -0
  37. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/docs/commands/merge.md +0 -0
  38. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/docs/plans/2026-11-05-worktree-pruning-design.md +0 -0
  39. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/functions/gw.fish +0 -0
  40. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/functions/gwa.fish +0 -0
  41. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/functions/gwbc.fish +0 -0
  42. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/functions/gwbp.fish +0 -0
  43. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/functions/gwbs.fish +0 -0
  44. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/functions/gwff.fish +0 -0
  45. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/functions/gwl.fish +0 -0
  46. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/functions/gwm.fish +0 -0
  47. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/functions/gwp!.fish +0 -0
  48. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/functions/gwp.fish +0 -0
  49. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/functions/gwpa!.fish +0 -0
  50. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/functions/gwpa.fish +0 -0
  51. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/functions/gwr!.fish +0 -0
  52. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/functions/gwr.fish +0 -0
  53. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/functions/gws.fish +0 -0
  54. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/hatch_build.py +0 -0
  55. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/README.md +0 -0
  56. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/hooks/codex.json +0 -0
  57. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/hooks/hooks.json +0 -0
  58. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/session.md +0 -0
  59. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/skills/ci-checks/SKILL.md +0 -0
  60. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/skills/describe-pr/SKILL.md +0 -0
  61. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/skills/describe-pr/format.md +0 -0
  62. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/skills/fast-forward/SKILL.md +0 -0
  63. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/skills/preflight/SKILL.md +0 -0
  64. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/skills/preflight/agents/openai.yaml +0 -0
  65. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/skills/preflight/rules.json +0 -0
  66. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/skills/prune/SKILL.md +0 -0
  67. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/skills/ship-it/SKILL.md +0 -0
  68. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/plugin/skills/ship-it/rights.md +0 -0
  69. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/renovate.json +0 -0
  70. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/scripts/README.md +0 -0
  71. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/scripts/benchmark.py +0 -0
  72. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/scripts/bump_version.py +0 -0
  73. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/scripts/verify-publish.bash +0 -0
  74. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/__init__.py +0 -0
  75. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/audit.py +0 -0
  76. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/branch_cli.py +0 -0
  77. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/branch_forge.py +0 -0
  78. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/branches.py +0 -0
  79. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/ci.py +0 -0
  80. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/errors.py +0 -0
  81. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/fast_forward.py +0 -0
  82. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/forge.py +0 -0
  83. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/git.py +0 -0
  84. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/layout.py +0 -0
  85. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/merged.py +0 -0
  86. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/new_branch.py +0 -0
  87. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/pick.py +0 -0
  88. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/pr_merge.py +0 -0
  89. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/progress.py +0 -0
  90. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/render.py +0 -0
  91. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/repo.py +0 -0
  92. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/sync.py +0 -0
  93. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/src/worktrees/verdicts.py +0 -0
  94. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/audit_schema.py +0 -0
  95. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/conftest.py +0 -0
  96. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_assessment.py +0 -0
  97. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_audit.py +0 -0
  98. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_benchmark.py +0 -0
  99. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_branch_forge.py +0 -0
  100. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_branches.py +0 -0
  101. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_ci.py +0 -0
  102. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_cli.py +0 -0
  103. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_command_defaults.py +0 -0
  104. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_completions.py +0 -0
  105. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_fast_forward.py +0 -0
  106. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_fixture.py +0 -0
  107. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_forge.py +0 -0
  108. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_gates.py +0 -0
  109. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_git_records.py +0 -0
  110. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_new_branch.py +0 -0
  111. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_partial_clone.py +0 -0
  112. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_path_boundaries.py +0 -0
  113. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_plugin.py +0 -0
  114. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_pr_merge.py +0 -0
  115. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_render.py +0 -0
  116. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_shims.py +0 -0
  117. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_spec.py +0 -0
  118. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_sync.py +0 -0
  119. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_version.py +0 -0
  120. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/tests/test_worktree.py +0 -0
  121. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/completions/_gw +0 -0
  122. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gw +0 -0
  123. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwa +0 -0
  124. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwbc +0 -0
  125. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwbp +0 -0
  126. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwbs +0 -0
  127. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwff +0 -0
  128. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwl +0 -0
  129. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwm +0 -0
  130. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwp +0 -0
  131. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwp! +0 -0
  132. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwpa +0 -0
  133. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwpa! +0 -0
  134. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwr +0 -0
  135. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwr! +0 -0
  136. {git_worktrees-0.12.0 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gws +0 -0
@@ -5,7 +5,7 @@ run-name: Release ${{ inputs.version && format('v{0}', inputs.version) || github
5
5
  # request against the repository, this workflow's FILENAME and the environment,
6
6
  # so a rename means re-registering the publisher on PyPI first.
7
7
  #
8
- # build -> tag -> publish -> release
8
+ # build -> tag -> publish -> release -> list
9
9
  # \-> verify
10
10
  #
11
11
  # A release is a version bump merged into main, then published one of two
@@ -22,8 +22,9 @@ run-name: Release ${{ inputs.version && format('v{0}', inputs.version) || github
22
22
  # is left to prove before the upload PyPI cannot take back is that the wheel
23
23
  # runs, and build installs it and does that.
24
24
  #
25
- # No API token is stored anywhere. See docs/DEVELOPMENT.md, "Publishing a
26
- # version".
25
+ # No PyPI token is stored anywhere. The one stored credential is the
26
+ # automation App's key, which list uses to reach the marketplace. See
27
+ # docs/DEVELOPMENT.md, "Publishing a version" and "Listing the plugin".
27
28
 
28
29
  on:
29
30
  push:
@@ -313,3 +314,146 @@ jobs:
313
314
  tag_name: ${{ env.TAG }}
314
315
  body_path: RELEASE_NOTES.md
315
316
  make_latest: true
317
+
318
+ # MihaiBojin/agent-plugins lists the agent plugin at a release tag, and a
319
+ # client installs the tag that listing names. This job opens the pull
320
+ # request that moves it to this one. GITHUB_TOKEN reaches no other
321
+ # repository, so the job runs as the automation App; without the App's
322
+ # GH_APP_CLIENT_ID it warns and changes nothing.
323
+ list:
324
+ name: List the plugin in the marketplace
325
+ runs-on: ubuntu-24.04
326
+ needs: release
327
+ if: ${{ !cancelled() && needs.release.result == 'success' }}
328
+ permissions:
329
+ contents: read
330
+ env:
331
+ MARKETPLACE: ${{ github.repository_owner }}/agent-plugins
332
+ steps:
333
+ - name: Warn that the App is not configured
334
+ if: vars.GH_APP_CLIENT_ID == ''
335
+ run: >-
336
+ echo "::warning::GH_APP_CLIENT_ID is not set, so $MARKETPLACE still
337
+ lists the previous tag. See docs/DEVELOPMENT.md, \"Listing the plugin\"."
338
+
339
+ - name: Mint a token for the marketplace
340
+ id: app-token
341
+ if: vars.GH_APP_CLIENT_ID != ''
342
+ uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
343
+ with:
344
+ client-id: ${{ vars.GH_APP_CLIENT_ID }}
345
+ private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
346
+ owner: ${{ github.repository_owner }}
347
+ repositories: agent-plugins
348
+ permission-contents: write
349
+ permission-pull-requests: write
350
+
351
+ # The release commit, for the description the plugin ships with.
352
+ - name: Checkout code
353
+ if: vars.GH_APP_CLIENT_ID != ''
354
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
355
+ with:
356
+ path: source
357
+ persist-credentials: false
358
+
359
+ - name: Checkout the marketplace
360
+ if: vars.GH_APP_CLIENT_ID != ''
361
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
362
+ with:
363
+ repository: ${{ env.MARKETPLACE }}
364
+ token: ${{ steps.app-token.outputs.token }}
365
+ path: marketplace
366
+ persist-credentials: false
367
+
368
+ # The listing's ref and description, then both catalogs from them with
369
+ # the marketplace's own sync script. The README's row is shorter
370
+ # hand-written prose and stays as it is.
371
+ - name: Point the listing at this tag
372
+ id: bump
373
+ if: vars.GH_APP_CLIENT_ID != ''
374
+ working-directory: marketplace
375
+ run: |
376
+ set -euo pipefail
377
+ description="$(jq -er .description ../source/plugin/.claude-plugin/plugin.json)"
378
+ node -e '
379
+ const fs = require("node:fs");
380
+ const [tag, description] = process.argv.slice(1);
381
+ const plugins = JSON.parse(fs.readFileSync("remote-plugins.json", "utf8"));
382
+ const entry = plugins.find((plugin) => plugin.name === "worktrees");
383
+ if (!entry) throw new Error("remote-plugins.json lists no worktrees");
384
+ entry.ref = tag;
385
+ entry.description = description;
386
+ fs.writeFileSync("remote-plugins.json", JSON.stringify(plugins, null, 2) + "\n");
387
+ ' "$TAG" "$description"
388
+ node scripts/sync-catalogs.mjs
389
+ if git diff --quiet; then
390
+ echo "$MARKETPLACE already lists $TAG." >&2
391
+ echo "changed=false" >>"$GITHUB_OUTPUT"
392
+ exit 0
393
+ fi
394
+ git diff --stat
395
+ staged="$RUNNER_TEMP/listing"
396
+ git diff --name-only | while read -r file; do
397
+ mkdir -p "$staged/$(dirname "$file")"
398
+ cp "$file" "$staged/$file"
399
+ done
400
+ echo "staged=$staged" >>"$GITHUB_OUTPUT"
401
+ echo "changed=true" >>"$GITHUB_OUTPUT"
402
+
403
+ # signed-push commits onto a branch that exists, so the branch starts at
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.
406
+ - name: Create the branch
407
+ id: branch
408
+ if: steps.bump.outputs.changed == 'true'
409
+ working-directory: marketplace
410
+ env:
411
+ GH_TOKEN: ${{ steps.app-token.outputs.token }}
412
+ run: |
413
+ set -euo pipefail
414
+ branch="worktrees-$TAG"
415
+ echo "name=$branch" >>"$GITHUB_OUTPUT"
416
+ if gh api "repos/$MARKETPLACE/git/ref/heads/$branch" >/dev/null 2>&1; then
417
+ open="$(gh pr list --repo "$MARKETPLACE" --head "$branch" --state open --json url --jq '.[].url')"
418
+ if [ -n "$open" ]; then
419
+ echo "$branch already has a pull request: $open" >&2
420
+ echo "action=none" >>"$GITHUB_OUTPUT"
421
+ exit 0
422
+ fi
423
+ echo "::error::$MARKETPLACE has a branch $branch with no open pull request. Open one for it or delete it, then re-run this job."
424
+ exit 1
425
+ fi
426
+ gh api --method POST "repos/$MARKETPLACE/git/refs" \
427
+ -f ref="refs/heads/$branch" -f sha="$(git rev-parse HEAD)" >/dev/null
428
+ echo "action=commit" >>"$GITHUB_OUTPUT"
429
+
430
+ # The marketplace's main requires verified signatures, which a commit
431
+ # made with git on the runner lacks. signed-push commits through the
432
+ # API, which GitHub signs for the App.
433
+ - name: Commit the listing, signed
434
+ if: steps.branch.outputs.action == 'commit'
435
+ uses: releasetools/actions/signed-push@9828828b39bb2261f95b6f45749fb96ce22c9d2d # v0.12.1
436
+ with:
437
+ source-dir: ${{ steps.bump.outputs.staged }}
438
+ target-repo: ${{ env.MARKETPLACE }}
439
+ target-branch: ${{ steps.branch.outputs.name }}
440
+ headline: "chore(worktrees): List ${{ env.TAG }}"
441
+ body: |
442
+ Source-Tag: <${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ env.TAG }}>
443
+ prune: "false"
444
+ token: ${{ steps.app-token.outputs.token }}
445
+
446
+ # Opened as the App, so the marketplace's own checks run on it. Merging
447
+ # is left to a person.
448
+ - name: Open the pull request
449
+ if: steps.branch.outputs.action == 'commit'
450
+ env:
451
+ GH_TOKEN: ${{ steps.app-token.outputs.token }}
452
+ BRANCH: ${{ steps.branch.outputs.name }}
453
+ RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
454
+ run: |
455
+ body="$(printf '%s\n\n%s\n' \
456
+ "The \`worktrees\` listing installs the plugin from its $TAG tag." \
457
+ "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"
@@ -545,6 +545,18 @@ git process whose work is the CPU's, so more threads than cores only queue
545
545
  behind each other and the interpreter lock; `sync` keeps eight, since its
546
546
  threads wait on the network. Mutations remain serial.
547
547
 
548
+ The recheck after confirmation is an assessment too, so `gw prune` runs one
549
+ for the whole batch, `worktree.recheck`, on the same threads, and then
550
+ removes one target at a time. Rechecking before each removal read every
551
+ checkout one after another, which a repository whose `git status` takes
552
+ half a minute pays once a target. Just before it deletes, `worktree.remove`
553
+ still checks the head and the worktree's record, branch, sha and flags, so
554
+ a ref an earlier removal moved refuses the later one, and
555
+ `git worktree remove` refuses a checkout dirtied since. What the wider gap
556
+ leaves open is an ignored path written between the batch recheck and that
557
+ target's removal. A single target, as `gw remove` has, is rechecked as it
558
+ is removed.
559
+
548
560
  An assessment asks every worktree the same questions about the head, so
549
561
  `merged.reuse()` keeps the answers that name objects by full SHA for the
550
562
  length of one `assess`: a commit's tree, a merge base, the patch-ids of the
@@ -17,6 +17,18 @@ 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.12.1 - 2026-11-16
21
+
22
+ ### Changed
23
+
24
+ `gw prune` rechecks every worktree you approved in one pass, on the same
25
+ threads as the first assessment, then removes them one at a time. In a
26
+ repository where `git status` takes half a minute, removing several
27
+ worktrees no longer waits that long for each one. Each removal still
28
+ refuses a ref an earlier removal moved and a checkout dirtied since, and
29
+ an ignored path written after the batch recheck goes with its worktree.
30
+ `gw remove` rechecks its one target as it removes it, as before.
31
+
20
32
  ## 0.12.0 - 2026-11-16
21
33
 
22
34
  ### Changed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: git-worktrees
3
- Version: 0.12.0
3
+ Version: 0.12.1
4
4
  Summary: Git worktree commands that refuse to lose work.
5
5
  Project-URL: Bug reports, https://github.com/MihaiBojin/worktrees/issues/new
6
6
  Project-URL: Source, https://github.com/MihaiBojin/worktrees
@@ -104,7 +104,7 @@ the plugin's tag to the same release, as each manager below describes.
104
104
  ### fish
105
105
 
106
106
  ```console
107
- fisher install MihaiBojin/worktrees@v0.12.0
107
+ fisher install MihaiBojin/worktrees@v0.12.1
108
108
  ```
109
109
 
110
110
  Fisher copies `functions/`, `completions/` and `conf.d/` from the repository
@@ -121,7 +121,7 @@ the untagged one holds the files.
121
121
  Antidote takes a `path:` into the repository, and `branch:` takes a tag:
122
122
 
123
123
  ```
124
- MihaiBojin/worktrees branch:v0.12.0 path:zsh/plugins/worktrees # in zsh_plugins.txt
124
+ MihaiBojin/worktrees branch:v0.12.1 path:zsh/plugins/worktrees # in zsh_plugins.txt
125
125
  ```
126
126
 
127
127
  The plugin puts its own `functions/` and `completions/` on `fpath` and
@@ -196,8 +196,8 @@ its stdout stays the version alone for a script to read.
196
196
  An excerpt of `gw --help`'s release lines with matching CLI and shell releases:
197
197
 
198
198
  ```console
199
- worktrees 0.12.0: git worktree commands that refuse to lose work
200
- The shell plugin here is 0.12.0, the same release as these commands.
199
+ worktrees 0.12.1: git worktree commands that refuse to lose work
200
+ The shell plugin here is 0.12.1, the same release as these commands.
201
201
  ```
202
202
 
203
203
  A shell without the variable has no plugin loaded, or one older than the
@@ -378,6 +378,10 @@ Below the list, `git -C PATH ls-files --others --ignored --exclude-standard`
378
378
  lists every ignored file, for you to read before answering.
379
379
  Quiet, JSON and `--yes` keep this disclosure on stderr.
380
380
  It repeats the assessment after confirmation and refuses changed targets.
381
+ `gw prune` repeats it for every target together, before the first removal,
382
+ so a repository with a slow `git status` waits for it once and not once a
383
+ worktree; each removal then checks the head branch and the worktree's
384
+ record again, and `git worktree remove` refuses a checkout changed since.
381
385
  Ignored directory entries can cover a whole directory; the recheck compares
382
386
  Git's ignored path listing, not a fingerprint of every file's contents.
383
387
 
@@ -77,7 +77,7 @@ the plugin's tag to the same release, as each manager below describes.
77
77
  ### fish
78
78
 
79
79
  ```console
80
- fisher install MihaiBojin/worktrees@v0.12.0
80
+ fisher install MihaiBojin/worktrees@v0.12.1
81
81
  ```
82
82
 
83
83
  Fisher copies `functions/`, `completions/` and `conf.d/` from the repository
@@ -94,7 +94,7 @@ the untagged one holds the files.
94
94
  Antidote takes a `path:` into the repository, and `branch:` takes a tag:
95
95
 
96
96
  ```
97
- MihaiBojin/worktrees branch:v0.12.0 path:zsh/plugins/worktrees # in zsh_plugins.txt
97
+ MihaiBojin/worktrees branch:v0.12.1 path:zsh/plugins/worktrees # in zsh_plugins.txt
98
98
  ```
99
99
 
100
100
  The plugin puts its own `functions/` and `completions/` on `fpath` and
@@ -169,8 +169,8 @@ its stdout stays the version alone for a script to read.
169
169
  An excerpt of `gw --help`'s release lines with matching CLI and shell releases:
170
170
 
171
171
  ```console
172
- worktrees 0.12.0: git worktree commands that refuse to lose work
173
- The shell plugin here is 0.12.0, the same release as these commands.
172
+ worktrees 0.12.1: git worktree commands that refuse to lose work
173
+ The shell plugin here is 0.12.1, the same release as these commands.
174
174
  ```
175
175
 
176
176
  A shell without the variable has no plugin loaded, or one older than the
@@ -351,6 +351,10 @@ Below the list, `git -C PATH ls-files --others --ignored --exclude-standard`
351
351
  lists every ignored file, for you to read before answering.
352
352
  Quiet, JSON and `--yes` keep this disclosure on stderr.
353
353
  It repeats the assessment after confirmation and refuses changed targets.
354
+ `gw prune` repeats it for every target together, before the first removal,
355
+ so a repository with a slow `git status` waits for it once and not once a
356
+ worktree; each removal then checks the head branch and the worktree's
357
+ record again, and `git worktree remove` refuses a checkout changed since.
354
358
  Ignored directory entries can cover a whole directory; the recheck compares
355
359
  Git's ignored path listing, not a fingerprint of every file's contents.
356
360
 
@@ -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.12.0
7
+ set -gx WORKTREES_PLUGIN_VERSION 0.12.1
@@ -274,7 +274,7 @@ it with the version and the release commit, and its `tag` job creates the tag
274
274
  on that commit.
275
275
 
276
276
  ```
277
- build ──> tag ──> publish ──> release
277
+ build ──> tag ──> publish ──> release ──> list
278
278
  └─> verify
279
279
  ```
280
280
 
@@ -312,6 +312,39 @@ does not start `publish.yml` again. A dispatch that fails after `tag` is
312
312
  finished by re-running its failed jobs, since a fresh dispatch refuses the tag
313
313
  that run made.
314
314
 
315
+ ## Listing the plugin
316
+
317
+ `MihaiBojin/agent-plugins` lists the agent plugin as `worktrees@mihaibojin`,
318
+ from an entry in its `remote-plugins.json` pinned to a release tag. A client
319
+ installs the tag that entry names, so until it moves every client keeps the
320
+ previous plugin.
321
+
322
+ `list` runs after `release` and opens the pull request that moves it. It sets
323
+ the entry's `ref` to the tag and its `description` to the one in
324
+ `plugin/.claude-plugin/plugin.json` at the release commit, runs the
325
+ marketplace's `scripts/sync-catalogs.mjs` to write both catalogs, commits the
326
+ result to `worktrees-v<version>` through `signed-push` and opens
327
+ `chore(worktrees): List v<version>`. The marketplace's checks run on it, and
328
+ merging it is left to a person. The README row there is shorter prose of its
329
+ own and is not touched. A rerun finds the branch and stops: done when its pull
330
+ request is open, an error naming the branch when it is not.
331
+
332
+ `GITHUB_TOKEN` cannot write to another repository, so the job runs as a
333
+ GitHub App, the same setup `releasetools/cli` uses to reach its Homebrew tap.
334
+ The App needs Contents and Pull requests write, and an installation covering
335
+ `worktrees` and `agent-plugins`. A personal account has no account-level
336
+ Actions secrets, so both values live on this repository:
337
+
338
+ ```console
339
+ gh variable set GH_APP_CLIENT_ID -R MihaiBojin/worktrees --body <client-id>
340
+ gh secret set GH_APP_PRIVATE_KEY -R MihaiBojin/worktrees < <app>.private-key.pem
341
+ ```
342
+
343
+ `scripts/create-github-app.sh` in `releasetools/terraform-modules` creates
344
+ such an App from a manifest and prints these two commands. Without
345
+ `GH_APP_CLIENT_ID` the job warns and changes nothing, and the listing is
346
+ moved by hand: the same edit, `npm run sync`, and a pull request.
347
+
315
348
  ## Snapshots on TestPyPI
316
349
 
317
350
  `testpypi.yml` runs on every commit to `main`. It numbers the tree
@@ -343,7 +376,7 @@ enforces.
343
376
  The suite is not run again there. `tests.yml` runs it on the same commit, and
344
377
  a snapshot a test would have caught costs one number on a test index.
345
378
 
346
- No API token is stored anywhere. Every upload uses Trusted Publishing over
379
+ No PyPI token is stored anywhere. Every upload uses Trusted Publishing over
347
380
  OIDC, which matches a request against the repository, the workflow filename
348
381
  and the environment, so each row below is its own registration:
349
382
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "worktrees",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Read CI, rebase onto the head branch, describe, ship and merge pull requests, and prune finished worktrees through the worktrees CLI",
5
5
  "author": {
6
6
  "name": "Mihai Bojin",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "worktrees",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Read CI, rebase onto the head branch, describe, ship and merge pull requests, and prune finished worktrees through the worktrees CLI",
5
5
  "author": {
6
6
  "name": "Mihai Bojin",
@@ -1,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.12.0",
4
+ "version": "0.12.1",
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.12.0"
12
+ version = "0.12.1"
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.
@@ -611,7 +611,7 @@ def run_prune(args: argparse.Namespace) -> int:
611
611
  _err(render.note("nothing removed"))
612
612
  return 0
613
613
 
614
- outcomes = prune.sweep(go, _err)
614
+ outcomes = prune.sweep(go, _err, spin=not args.quiet and not args.verbose)
615
615
  failed = sum(bool(o.failed) for o in outcomes)
616
616
  removed = [v.label for v, o in zip(go, outcomes, strict=True) if o.worktree_removed]
617
617
  if args.json:
@@ -705,11 +705,25 @@ def never_synced(go: Sequence[Verdict | branches.Verdict]) -> bool:
705
705
  )
706
706
 
707
707
 
708
- def sweep(go: list[Verdict], say: Callable[[str], None], repo=None) -> list[Outcome]:
709
- """Remove independently approved targets and retain each step's outcome."""
710
- from . import worktree
708
+ def sweep(
709
+ go: list[Verdict],
710
+ say: Callable[[str], None],
711
+ repo=None,
712
+ *,
713
+ spin: bool = False,
714
+ ) -> list[Outcome]:
715
+ """Remove independently approved targets and retain each step's outcome.
711
716
 
712
- outcomes = [worktree.remove(v, say, repo=repo) for v in go]
717
+ The targets are rechecked together first, each checkout on its own
718
+ thread, then removed one at a time. `spin` draws the spinner meanwhile.
719
+ """
720
+ from . import progress, worktree
721
+
722
+ with progress.running(spin):
723
+ rechecked = worktree.recheck(go, repo)
724
+ outcomes = [
725
+ worktree.remove(v, say, repo=repo, rechecked=rechecked.get(v.path)) for v in go
726
+ ]
713
727
  worktree_prune(repo=repo)
714
728
  return outcomes
715
729
 
@@ -114,8 +114,57 @@ def _first_absent(dest_parent: Path, main: str) -> Path | None:
114
114
  return made
115
115
 
116
116
 
117
- def remove(chosen: Verdict, say, repo=None) -> prune.Outcome:
118
- """Recheck the approved worktree before removing its checkout and ref."""
117
+ def recheck(go: list[Verdict], repo=None) -> dict[str, Verdict]:
118
+ """Assess every approved worktree again, together, by path.
119
+
120
+ One assessment for the batch reads each checkout on its own thread, where
121
+ a recheck before each removal reads them one after another: a repository
122
+ whose `git status` takes half a minute pays that once, not once a
123
+ target. `remove` still checks the head and the worktree's record just
124
+ before it deletes, and `git worktree remove` refuses a checkout dirtied
125
+ since. Empty for a single target, for targets approved under different
126
+ terms, or when the assessment fails; `remove` then rechecks its own.
127
+ """
128
+ snapshots = [v.snapshot for v in go]
129
+ if len(go) < 2 or any(s is None for s in snapshots):
130
+ return {}
131
+ first = go[0]
132
+ head = snapshots[0].head # type: ignore[union-attr]
133
+ if any(
134
+ (v.permissions, v.keep_branch, s.head) # type: ignore[union-attr]
135
+ != (first.permissions, first.keep_branch, head)
136
+ for v, s in zip(go, snapshots, strict=True)
137
+ ):
138
+ return {}
139
+ wanted = {v.path for v in go}
140
+ try:
141
+ prune.check_head(head, repo)
142
+ fresh = assess(
143
+ [w for w in R.worktrees(repo) if w.path in wanted],
144
+ "",
145
+ head.ref,
146
+ head.branch,
147
+ repo=repo,
148
+ here="",
149
+ ask_forge=True,
150
+ include_main=True,
151
+ permissions=first.permissions,
152
+ keep_branch=first.keep_branch,
153
+ state=head,
154
+ )
155
+ except (GitError, Refused):
156
+ return {}
157
+ return {v.path: v for v in fresh}
158
+
159
+
160
+ def remove(
161
+ chosen: Verdict, say, repo=None, rechecked: Verdict | None = None
162
+ ) -> prune.Outcome:
163
+ """Recheck the approved worktree before removing its checkout and ref.
164
+
165
+ `rechecked` is this worktree's row from `recheck`, read with the rest of
166
+ its batch; without one the worktree is assessed here.
167
+ """
119
168
  outcome = prune.Outcome(
120
169
  path=chosen.path, branch=chosen.branch, retained=list(chosen.stashes)
121
170
  )
@@ -133,19 +182,22 @@ def remove(chosen: Verdict, say, repo=None) -> prune.Outcome:
133
182
  records[0].flags,
134
183
  ) != (snapshot.branch, snapshot.sha, snapshot.flags):
135
184
  raise Refused(f"{chosen.path}: worktree changed after assessment")
136
- fresh = assess(
137
- records,
138
- "",
139
- snapshot.head.ref,
140
- snapshot.head.branch,
141
- repo=repo,
142
- here="",
143
- ask_forge=True,
144
- include_main=True,
145
- permissions=chosen.permissions,
146
- keep_branch=chosen.keep_branch,
147
- state=snapshot.head,
148
- )[0]
185
+ fresh = (
186
+ rechecked
187
+ or assess(
188
+ records,
189
+ "",
190
+ snapshot.head.ref,
191
+ snapshot.head.branch,
192
+ repo=repo,
193
+ here="",
194
+ ask_forge=True,
195
+ include_main=True,
196
+ permissions=chosen.permissions,
197
+ keep_branch=chosen.keep_branch,
198
+ state=snapshot.head,
199
+ )[0]
200
+ )
149
201
  if fresh.snapshot != snapshot or not fresh.eligible:
150
202
  raise Refused(f"{chosen.path}: state changed after assessment; {fresh.why}")
151
203
  prune.check_head(snapshot.head, repo)
@@ -1111,3 +1111,28 @@ def test_remove_takes_no_only(world):
1111
1111
  p = run(world, "gw remove", "topic", "--only", "remove")
1112
1112
  assert p.returncode == 2
1113
1113
  assert "--only" in p.stderr
1114
+
1115
+
1116
+ def test_a_batch_is_rechecked_together_before_the_first_removal(world):
1117
+ """Every approved checkout is read again before anything goes, on the
1118
+ assessment's threads, not one before each removal: with a slow
1119
+ `git status`, a batch waits for it once."""
1120
+ paths = [world.merged_worktree(name) for name in ("one", "two", "three")]
1121
+ p = run(world, "gw prune", "--yes", "-v")
1122
+ assert p.returncode == 0, p.stderr
1123
+ assert not any(path.exists() for path in paths)
1124
+ log = p.stderr
1125
+ removals = [m.start() for m in re.finditer(r"git .*worktree remove -- ", log)]
1126
+ statuses = [m.start() for m in re.finditer(r"status --porcelain", log)]
1127
+ assert len(removals) == 3
1128
+ # Once each to assess and once each to recheck, all ahead of a removal.
1129
+ assert len(statuses) == 6
1130
+ assert statuses[-1] < removals[0]
1131
+
1132
+
1133
+ def test_a_single_target_is_rechecked_as_it_is_removed(world):
1134
+ path = world.merged_worktree("only")
1135
+ p = run(world, "gw prune", "--yes", "-v")
1136
+ assert p.returncode == 0, p.stderr
1137
+ assert not path.exists()
1138
+ assert p.stderr.count("status --porcelain") == 2
@@ -49,7 +49,7 @@ wheels = [
49
49
 
50
50
  [[package]]
51
51
  name = "git-worktrees"
52
- version = "0.12.0"
52
+ version = "0.12.1"
53
53
  source = { editable = "." }
54
54
 
55
55
  [package.optional-dependencies]
@@ -12,4 +12,4 @@ autoload -Uz gw gwa gwbc gwbp gwbs gwff gwl gwm gwp 'gwp!' gwpa 'gwpa!' gwr '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.12.0
15
+ export WORKTREES_PLUGIN_VERSION=0.12.1
File without changes
File without changes