git-worktrees 0.9.0__tar.gz → 0.10.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 (131) hide show
  1. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/.claude/settings.json +0 -1
  2. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/.codex/config.toml +0 -3
  3. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/.github/workflows/publish.yml +89 -16
  4. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/.releasetools.yaml +3 -0
  5. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/AGENTS.md +53 -19
  6. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/CHANGELOG.md +72 -0
  7. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/PKG-INFO +44 -20
  8. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/README.md +43 -19
  9. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/completions/gw.fish +7 -0
  10. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/conf.d/worktrees.fish +1 -1
  11. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/docs/DEVELOPMENT.md +25 -16
  12. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/docs/REFERENCE.md +29 -14
  13. git_worktrees-0.10.0/docs/commands/ci-checks.md +37 -0
  14. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/docs/commands/fast-forward.md +44 -13
  15. git_worktrees-0.10.0/docs/commands/merge.md +93 -0
  16. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/plugin/.claude-plugin/plugin.json +1 -1
  17. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/plugin/.codex-plugin/plugin.json +1 -1
  18. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/plugin/README.md +9 -7
  19. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/plugin/plugin.json +1 -1
  20. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/plugin/skills/ci-checks/SKILL.md +7 -1
  21. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/plugin/skills/fast-forward/SKILL.md +7 -1
  22. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/plugin/skills/preflight/rules.json +1 -1
  23. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/plugin/skills/prune/SKILL.md +2 -2
  24. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/plugin/skills/ship-it/SKILL.md +86 -49
  25. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/plugin/skills/ship-it/rights.md +14 -9
  26. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/pyproject.toml +1 -1
  27. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/branch_cli.py +4 -4
  28. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/branch_forge.py +61 -2
  29. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/branches.py +16 -8
  30. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/ci.py +72 -2
  31. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/cli.py +126 -23
  32. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/fast_forward.py +188 -24
  33. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/merged.py +2 -2
  34. git_worktrees-0.10.0/src/worktrees/pr_merge.py +338 -0
  35. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/prune.py +21 -5
  36. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/render.py +27 -8
  37. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/repo.py +16 -17
  38. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/verdicts.py +67 -18
  39. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/conftest.py +26 -0
  40. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_assessment.py +4 -2
  41. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_branch_forge.py +36 -5
  42. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_ci.py +153 -1
  43. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_cli.py +116 -1
  44. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_fast_forward.py +341 -2
  45. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_forge.py +5 -6
  46. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_gates.py +78 -12
  47. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_git_records.py +2 -2
  48. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_plugin.py +59 -2
  49. git_worktrees-0.10.0/tests/test_pr_merge.py +721 -0
  50. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_render.py +29 -1
  51. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_sync.py +27 -6
  52. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/uv.lock +1 -1
  53. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/completions/_gw +11 -0
  54. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/worktrees.plugin.zsh +1 -1
  55. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/.github/workflows/codeql.yml +0 -0
  56. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/.github/workflows/testpypi.yml +0 -0
  57. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/.github/workflows/tests.yml +0 -0
  58. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/.gitignore +0 -0
  59. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/.pre-commit-config.yaml +0 -0
  60. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/.python-version +0 -0
  61. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/LICENSE +0 -0
  62. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/Makefile +0 -0
  63. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/completions/worktrees.fish +0 -0
  64. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/docs/BENCHMARK.md +0 -0
  65. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/docs/commands/branch-prune.md +0 -0
  66. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/docs/commands/branch-status.md +0 -0
  67. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/docs/plans/2026-11-05-worktree-pruning-design.md +0 -0
  68. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/functions/gw.fish +0 -0
  69. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/functions/gwa.fish +0 -0
  70. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/functions/gwbc.fish +0 -0
  71. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/functions/gwbp.fish +0 -0
  72. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/functions/gwbs.fish +0 -0
  73. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/functions/gwff.fish +0 -0
  74. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/functions/gwl.fish +0 -0
  75. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/functions/gwm.fish +0 -0
  76. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/functions/gwp!.fish +0 -0
  77. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/functions/gwp.fish +0 -0
  78. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/functions/gwpa!.fish +0 -0
  79. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/functions/gwpa.fish +0 -0
  80. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/functions/gwr!.fish +0 -0
  81. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/functions/gwr.fish +0 -0
  82. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/functions/gws.fish +0 -0
  83. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/hatch_build.py +0 -0
  84. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/plugin/skills/describe-pr/SKILL.md +0 -0
  85. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/plugin/skills/describe-pr/format.md +0 -0
  86. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/plugin/skills/new-branch/SKILL.md +0 -0
  87. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/plugin/skills/preflight/SKILL.md +0 -0
  88. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/plugin/skills/preflight/agents/openai.yaml +0 -0
  89. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/renovate.json +0 -0
  90. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/scripts/README.md +0 -0
  91. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/scripts/benchmark.py +0 -0
  92. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/scripts/bump_version.py +0 -0
  93. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/scripts/verify-publish.bash +0 -0
  94. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/__init__.py +0 -0
  95. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/errors.py +0 -0
  96. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/forge.py +0 -0
  97. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/git.py +0 -0
  98. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/layout.py +0 -0
  99. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/new_branch.py +0 -0
  100. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/pick.py +0 -0
  101. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/progress.py +0 -0
  102. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/sync.py +0 -0
  103. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/src/worktrees/worktree.py +0 -0
  104. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_benchmark.py +0 -0
  105. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_branches.py +0 -0
  106. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_command_defaults.py +0 -0
  107. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_completions.py +0 -0
  108. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_fixture.py +0 -0
  109. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_new_branch.py +0 -0
  110. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_partial_clone.py +0 -0
  111. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_path_boundaries.py +0 -0
  112. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_removal.py +0 -0
  113. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_shims.py +0 -0
  114. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_spec.py +0 -0
  115. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_version.py +0 -0
  116. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/tests/test_worktree.py +0 -0
  117. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/functions/gw +0 -0
  118. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/functions/gwa +0 -0
  119. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/functions/gwbc +0 -0
  120. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/functions/gwbp +0 -0
  121. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/functions/gwbs +0 -0
  122. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/functions/gwff +0 -0
  123. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/functions/gwl +0 -0
  124. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/functions/gwm +0 -0
  125. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/functions/gwp +0 -0
  126. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/functions/gwp! +0 -0
  127. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/functions/gwpa +0 -0
  128. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/functions/gwpa! +0 -0
  129. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/functions/gwr +0 -0
  130. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/functions/gwr! +0 -0
  131. {git_worktrees-0.9.0 → git_worktrees-0.10.0}/zsh/plugins/worktrees/functions/gws +0 -0
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "enabledPlugins": {
3
- "release-notes@release-tools": true,
4
3
  "release@release-tools": true
5
4
  },
6
5
  "extraKnownMarketplaces": {
@@ -4,6 +4,3 @@ source = "https://github.com/releasetools/agent-plugins.git"
4
4
 
5
5
  [plugins."release@release-tools"]
6
6
  enabled = true
7
-
8
- [plugins."release-notes@release-tools"]
9
- enabled = true
@@ -1,15 +1,20 @@
1
1
  name: Publish
2
+ run-name: Release ${{ inputs.version && format('v{0}', inputs.version) || github.ref_name }}
2
3
 
3
4
  # Renaming this file breaks publishing. PyPI's Trusted Publishing matches a
4
5
  # request against the repository, this workflow's FILENAME and the environment,
5
6
  # so a rename means re-registering the publisher on PyPI first.
6
7
  #
7
- # build -> publish -> release
8
- # \-> verify
8
+ # build -> tag -> publish -> release
9
+ # \-> verify
9
10
  #
10
- # Nothing here creates a tag. A release is a version bump merged into main and
11
- # then tagged by hand, so the irreversible step is the last one and everything
12
- # before it is a normal reviewed change.
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.
13
18
  #
14
19
  # There is no TestPyPI rehearsal. testpypi.yml publishes every commit on main
15
20
  # there as <version>.post<epoch> and installs it back, so the tree this tag
@@ -24,13 +29,23 @@ on:
24
29
  push:
25
30
  tags:
26
31
  - "v*.*.*"
27
- # To re-run a release whose publish failed. Run it against a tag ref, not a
28
- # branch: every guard below reads the tag at HEAD.
29
32
  workflow_dispatch:
33
+ inputs:
34
+ version:
35
+ description: "The version to release, with no v (e.g. 0.9.1). The tag is v<version>."
36
+ required: true
37
+ commit:
38
+ description: "The release commit: its full SHA, or HEAD for whatever the dispatched ref names when the run starts."
39
+ required: false
40
+ default: HEAD
30
41
 
31
42
  permissions:
32
43
  contents: read
33
44
 
45
+ env:
46
+ # The tag this run releases: the one pushed, or the one a dispatch creates.
47
+ TAG: ${{ inputs.version && format('v{0}', inputs.version) || github.ref_name }}
48
+
34
49
  jobs:
35
50
  # Built once and handed to every job below, so what reaches PyPI is
36
51
  # byte-for-byte what was tested and installed here.
@@ -61,16 +76,49 @@ jobs:
61
76
  - name: Install the release tools
62
77
  uses: releasetools/cli@v0
63
78
 
64
- # Four guards, cheapest first. The tag has to name a version the
65
- # repository actually carries, that version has to have a changelog
66
- # entry, the commit has to be one main took, and its tests have to have
67
- # passed already. All of them here in build, because the release job
68
- # runs after the PyPI upload and a refusal there would be too late.
79
+ # The guards, cheapest first. A dispatched run builds whatever its ref
80
+ # names when it starts, so it has to be the commit the dispatch named,
81
+ # and the tag it would create must not exist yet. The tag has to name a
82
+ # version the repository actually carries, that version has to have a
83
+ # changelog entry, the commit has to be one main took, and its tests
84
+ # have to have passed already. All of them here in build, because the
85
+ # release job runs after the PyPI upload and a refusal there would be
86
+ # too late.
87
+ - name: Refuse a commit other than the release commit
88
+ if: github.event_name == 'workflow_dispatch'
89
+ env:
90
+ COMMIT: ${{ inputs.commit }}
91
+ run: |
92
+ if [ "$COMMIT" != HEAD ] && [ "$COMMIT" != "$GITHUB_SHA" ]; then
93
+ echo "::error::asked to release $COMMIT, but $GITHUB_REF_NAME is at $GITHUB_SHA"
94
+ exit 1
95
+ fi
96
+
97
+ - name: Refuse a version already tagged
98
+ if: github.event_name == 'workflow_dispatch'
99
+ env:
100
+ GH_TOKEN: ${{ github.token }} # no runner default
101
+ run: |
102
+ if gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/$TAG" >/dev/null 2>&1; then
103
+ echo "::error::$TAG already exists"
104
+ exit 1
105
+ fi
106
+
69
107
  - name: Check the tag matches the project version
108
+ if: github.event_name == 'push'
70
109
  run: rt git::assert_tag_version "$(uv version --short)"
71
110
 
111
+ - name: Check the dispatched version is the project version
112
+ if: github.event_name == 'workflow_dispatch'
113
+ run: |
114
+ DECLARED="v$(uv version --short)"
115
+ if [ "$DECLARED" != "$TAG" ]; then
116
+ echo "::error::pyproject.toml declares $DECLARED, not $TAG"
117
+ exit 1
118
+ fi
119
+
72
120
  - name: Check the changelog has an entry for it
73
- run: rt changelog::section "${GITHUB_REF_NAME#v}" >/dev/null
121
+ run: rt changelog::section "${TAG#v}" >/dev/null
74
122
 
75
123
  # github:: rather than git::, because this checkout is shallow and
76
124
  # merge-base answers from the history it has: on a truncated one it
@@ -100,7 +148,7 @@ jobs:
100
148
  - name: Install fish and zsh
101
149
  run: sudo apt-get update && sudo apt-get install -y fish zsh
102
150
 
103
- # The tag is the last chance to catch a regression, so both suites run.
151
+ # This run is the last chance to catch a regression, so both suites run.
104
152
  - name: Run tests
105
153
  run: |
106
154
  uv run --no-sync pytest tests -q
@@ -127,10 +175,32 @@ jobs:
127
175
  path: dist/
128
176
  if-no-files-found: error
129
177
 
178
+ # A dispatch tags the release commit here, after every guard and before the
179
+ # upload, so a second dispatch of the same version stops at this step. The
180
+ # tag is made with this run's GITHUB_TOKEN, which starts no workflow, so it
181
+ # does not start this one a second time. A pushed tag skips this job.
182
+ tag:
183
+ name: Tag the release commit
184
+ if: github.event_name == 'workflow_dispatch'
185
+ runs-on: ubuntu-24.04
186
+ needs: build
187
+ permissions:
188
+ contents: write
189
+ steps:
190
+ - name: Create the tag
191
+ env:
192
+ GH_TOKEN: ${{ github.token }} # no runner default
193
+ run: >-
194
+ gh api --method POST "repos/$GITHUB_REPOSITORY/git/refs"
195
+ -f "ref=refs/tags/$TAG" -f "sha=$GITHUB_SHA"
196
+
130
197
  publish:
131
198
  name: Publish to PyPI
132
199
  runs-on: ubuntu-24.04
133
- needs: build
200
+ needs: [build, tag]
201
+ # A pushed tag skips the tag job, and a job whose needs include a skipped
202
+ # one is skipped too unless its condition says otherwise.
203
+ if: ${{ !cancelled() && needs.build.result == 'success' && needs.tag.result != 'failure' }}
134
204
  # Binds this job to the trusted publisher registered for `pypi`. Add a
135
205
  # required reviewer on this environment for a manual gate before anything
136
206
  # reaches the real index.
@@ -172,6 +242,7 @@ jobs:
172
242
  matrix:
173
243
  os: [ubuntu-24.04, ubuntu-26.04]
174
244
  needs: publish
245
+ if: ${{ !cancelled() && needs.publish.result == 'success' }}
175
246
  permissions:
176
247
  contents: read
177
248
  steps:
@@ -221,6 +292,7 @@ jobs:
221
292
  name: Release
222
293
  runs-on: ubuntu-24.04
223
294
  needs: publish
295
+ if: ${{ !cancelled() && needs.publish.result == 'success' }}
224
296
  permissions:
225
297
  contents: write
226
298
  steps:
@@ -233,10 +305,11 @@ jobs:
233
305
  # What was written for this version, not a list of pull request titles.
234
306
  # build already proved the section exists, before anything was published.
235
307
  - name: Read the changelog entry
236
- run: rt changelog::section "${GITHUB_REF_NAME#v}" >RELEASE_NOTES.md
308
+ run: rt changelog::section "${TAG#v}" >RELEASE_NOTES.md
237
309
 
238
310
  - name: Release
239
311
  uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3
240
312
  with:
313
+ tag_name: ${{ env.TAG }}
241
314
  body_path: RELEASE_NOTES.md
242
315
  make_latest: true
@@ -22,4 +22,7 @@ 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
28
  registry: https://pypi.org/pypi/git-worktrees/{version}/json
@@ -100,6 +100,16 @@ squash holds more than the two share, so no local proof marks the shared
100
100
  part; `branch_forge.carried_by` asks the forge which merged request carried
101
101
  the branch's oldest commit, and that request's commit list marks it, read
102
102
  from one page of 100 by choice: a parent seldom drifts further.
103
+ GitHub rewrites that stacked branch's remote copy itself when the parent
104
+ merges, so the branch takes the copy instead, through `_rewritten`: no
105
+ commit in the branch's reflog may reach it, which is when
106
+ `--force-if-includes` refuses the push, and its patch-ids must be the
107
+ branch's own, in order. A copy the branch's own push left is in that reflog,
108
+ so a branch rebased here after its push keeps its newer commits. A run
109
+ before the rewrite arrives finds the copy still holding the merged part;
110
+ when `branch_forge.in_stack` says the open pull request is in a native
111
+ stack, `_awaited` fetches every `REWRITE_INTERVAL` seconds until it
112
+ arrives, and refuses, with the offline command, after `REWRITE_WAIT`.
103
113
  Once a carry finishes, each stash made after the merged part moves to the
104
114
  replayed copy of its commit, matched by patch-id:
105
115
  `git merge-tree --write-tree` re-bases it without touching the checkout,
@@ -189,7 +199,7 @@ assumes a plugin root or a checkout at a known path.
189
199
  | `ci-checks` | `gw ci-checks --json`, `--wait` to wait without polling |
190
200
  | `describe-pr` | checks a review's title and body against its diff, and edits them |
191
201
  | `prune` | `gw prune --json` and `gw branch status --json`, then the removals approved |
192
- | `ship-it` | commits, `fast-forward`, a leased or plain push, `gh pr create`, `describe-pr`, `ci-checks`, fixes on the branch, `gh pr merge`, then `fast-forward` in the head branch's checkout, unassisted, for this checkout or each branch it is named; given numbers, those open reviews from `ci-checks` on |
202
+ | `ship-it` | commits, `fast-forward`, a leased or plain push, `gh pr create`, `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 |
193
203
  | `preflight` | `jq` merges `preflight/rules.json` into the user's or the project's `.claude/settings.json`, after asking |
194
204
 
195
205
  `describe-pr` and `ship-it` share `describe-pr/format.md`: the
@@ -417,14 +427,17 @@ when eight threads are asking at once.
417
427
  `gw sync` fetches every remote with `--prune --tags --no-prune-tags`, the
418
428
  default first, updates the default remote's HEAD and queries the forge for
419
429
  every local branch tip on eight threads. Every other command but
420
- `gw version`, `gw ci-checks`, `gw fast-forward`, help and completion runs
421
- the same `sync.run` first when
430
+ `gw version`, `gw list`, `gw ci-checks`, `gw merge`, `gw fast-forward`, help and
431
+ completion runs the same `sync.run` first when
422
432
  `sync.due` says so: the default remote's refs time is null or at least
423
433
  `WORKTREES_SYNC_TTL` seconds old, 60 by default. The forge time is not read,
424
434
  since a forge that keeps failing would sync before every command. Without a
425
435
  default remote nothing syncs first, because sync records nothing there.
426
- `gw fast-forward` runs `sync.fetch` on every run instead, which fetches the
427
- default remote and records the refs time.
436
+ `gw list` reads only the worktree records, so it never syncs first and
437
+ prints no word about how fresh the evidence is; its `--json` takes `head`
438
+ and `lastSync` from the cache. `gw fast-forward` runs `sync.fetch` on
439
+ every run instead, which fetches the default remote and records the refs
440
+ time.
428
441
 
429
442
  A failed sync before a command is a warning, and the command goes on with
430
443
  the evidence it has; quiet and JSON hide the warning. A failed fetch before
@@ -437,6 +450,15 @@ first, and `gw sync` and `gw ci-checks` refuse at exit 3. Every notice that woul
437
450
  `Run: gw sync` goes through `sync.hint`, which leaves that off offline,
438
451
  since it names a command that refuses there.
439
452
 
453
+ `gw merge` squashes one GitHub PR at a supplied head SHA. It waits up to ten
454
+ minutes, polling every five seconds, for lower stack members to merge, the
455
+ base to match the stack base and the head to contain the latest parent merge.
456
+ A rewritten head returns `head-moved` at exit 4 without submitting. It reads
457
+ fresh CI and verifies membership and containment again before calling the
458
+ asynchronous merge API, then polls a pending operation for one minute. `enqueued` is queued, not merged. Both clients call
459
+ the same command; their rules admit `gw merge` without general `gh api`
460
+ writes. [Merge](docs/commands/merge.md) describes the result and refusals.
461
+
440
462
  `gw ci-checks` reads one review and its checks from the forge each time it
441
463
  runs and writes nothing, the sync cache included. It never syncs first: its
442
464
  answer comes from the forge, not from local evidence.
@@ -467,13 +489,18 @@ patch-id input and creates no synthetic commits.
467
489
  The per-worktree checks run on eight threads. Mutations remain serial.
468
490
 
469
491
  `gw ci-checks` takes GitHub's review and checks from one `gh pr view` with
470
- `statusCheckRollup`, so both describe one head and nothing can go stale
471
- between them. It keeps the newest run per workflow and name, and a run with
492
+ `statusCheckRollup` and `commits`. Commit messages and checks describe the
493
+ same `headSha`. `pr.trailers` holds each trailer once, in commit order,
494
+ oldest first, parsed with `git interpret-trailers --parse`. An incomplete
495
+ commit list gives null trailers; GitHub's 100-commit cap also gives null.
496
+
497
+ It keeps the newest run per workflow and name, and a run with
472
498
  no start time counts as newest, so a queued re-run supersedes the failure it
473
499
  repeats. GitLab needs several calls: the pipeline is read from the project
474
- that ran it, its jobs across every page, and the merge request again
475
- afterwards, and a change between the two reads is `stale`. A pipeline for
476
- another SHA is stale unless it is the merged-result pipeline whose parents
500
+ that ran it, its jobs and the MR's commits across every page, then the merge
501
+ request again. A change between the two reads is `stale` and clears the
502
+ trailers. A pipeline for another SHA is stale unless it is the merged-result
503
+ pipeline whose parents
477
504
  are the current head and the target's tip. `ci.wait` takes its clock and
478
505
  sleep as arguments, so its tests run in-process without waiting.
479
506
 
@@ -568,7 +595,10 @@ not a divergent local counterpart.
568
595
  Content proof compares changed paths, modes and deletions against the head.
569
596
  It cannot settle a stacked branch whose intermediate content the head later
570
597
  edited. Cached forge proof verifies source tip, source repository, target
571
- branch and merge ancestry. Closed unmerged requests are never proof.
598
+ branch and merge ancestry. A request stacked on another branch keeps that
599
+ branch as its target after the forge lands it on the head, so a merge commit
600
+ on the head's first-parent history stands in for the target branch. Closed
601
+ unmerged requests are never proof.
572
602
 
573
603
  `eligible` combines proof, protections and `--delete` permissions.
574
604
  `prune.removable()` selects only eligible rows. `main`, `master` and the
@@ -588,13 +618,15 @@ worktree removal, full-SHA ref deletion and approved stash drops. Ignored
588
618
  paths are what an ignore pattern names, so a matched directory is one entry;
589
619
  the snapshot is a path listing, not a recursive content fingerprint, and a
590
620
  file created inside a listed directory after assessment goes with it. The
591
- disclosure, the protection's count and the JSON `ignored` field cut each
592
- listed path to its first component below the `.gitignore` whose pattern
593
- matched it, found with `git check-ignore -v`, and the disclosure quotes a
594
- path holding a character that would not print, as `git status` does. A pattern from
595
- `.git/info/exclude` or `core.excludesFile` counts from the top level, so
596
- `build/out/a.log` reads as `build/`. Stash drops verify SHA and repair a
597
- concurrent wrong-entry drop using the exact subject. Restoration remains
621
+ disclosure, the protection's count and the JSON `ignored` field list each
622
+ path as git does, from the top level, sorted, so a tracked directory above
623
+ an ignored one never reads as ignored. A path whose pattern, found with
624
+ `git check-ignore -v`, ends in a bare `*` or `**` reads as its directory,
625
+ since that pattern names the directory's contents. The disclosure quotes a
626
+ path holding a character that would not print, as `git status` does, and
627
+ ends with the `git -C PATH ls-files --others --ignored --exclude-standard`
628
+ line that lists every file below those entries. Stash drops verify SHA and
629
+ repair a concurrent wrong-entry drop using the exact subject. Restoration remains
598
630
  possible until Git garbage collection prunes the unreachable stash commit.
599
631
  Report checkout, branch and stash outcomes separately after partial failure.
600
632
 
@@ -615,7 +647,9 @@ code forever.
615
647
  The fixture needs no global git config, no signing key, no forge and no
616
648
  network. `GIT_CONFIG_GLOBAL` carries that: without it git still reads
617
649
  `$HOME/.gitconfig`, and setting `HOME` alone still leaves
618
- `$XDG_CONFIG_HOME/git/config`. `WORKTREES_OFFLINE=1` in `conftest.ENV` stops
650
+ `$XDG_CONFIG_HOME/git/config`. `XDG_CONFIG_HOME` points at the test's own
651
+ directory too, since `GIT_CONFIG_GLOBAL` does not reach `git/ignore`, the
652
+ default `core.excludesFile`. `WORKTREES_OFFLINE=1` in `conftest.ENV` stops
619
653
  a command syncing first, which would fetch a remote at `github.com` for
620
654
  real. `Network.env` clears it for the fake network, and `conftest.online`
621
655
  for a remote on disk.
@@ -17,6 +17,78 @@ 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.10.0 - 2026-11-13
21
+
22
+ ### Added
23
+
24
+ `gw merge NUMBER --match-head-commit SHA` squashes one GitHub pull
25
+ request after checking its head and CI. It respects merge queues and
26
+ waits up to ten minutes for lower native-stack pull requests and the
27
+ head rewrite. A rewritten head returns `head-moved` at exit 4 without
28
+ submitting. `/worktrees:ship-it` waits for CI on that head and rebuilds
29
+ the message before one retry. `/worktrees:ship-it` always squashes on
30
+ GitHub and GitLab.
31
+
32
+ `gw ci-checks --json` includes `pr.trailers`, preserving full coauthor
33
+ and session trailers once each in commit order. `/worktrees:ship-it`
34
+ uses these trailers for squash messages. Missing or incomplete commit
35
+ lists stop `/worktrees:ship-it`; GitHub reviews with 100 or more commits
36
+ have null trailers.
37
+
38
+ The WHY column of the `gw prune`, `gw remove`, `gw branch status` and
39
+ `gw branch prune` tables puts each reason on its own line: the evidence
40
+ first, then every protection under it. The JSON `why` field is unchanged.
41
+
42
+ ### Fixed
43
+
44
+ After the counts, `gw prune` lists every worktree it holds back, one to a
45
+ line with each reason, and leaves out the main checkout; `gw remove` does
46
+ the same for its target. When only `--delete` values hold worktrees back,
47
+ `gw prune` names the command that grants them, keeping the values you
48
+ passed: `gw prune --delete ignored-files makes fix-parser eligible`. The
49
+ list replaces the warning that named unknown worktrees. `gw remove`
50
+ suggests `--keep-branch` only when that flag would make the target
51
+ eligible.
52
+
53
+ When an empty branch or its stashes hold a worktree or a branch back, the
54
+ reason names the value that lifts it: `the branch is empty; pass --delete
55
+ empty` and `its branch has stashes; pass --delete stashes`. Main, master
56
+ and the head branch list only `it is a protected branch`, since no
57
+ `--delete` value frees them.
58
+
59
+ The removal disclosure, the "it holds N ignored path(s)" count and
60
+ `gw prune --json`'s `ignoredPaths` list each ignored path as the pattern
61
+ that ignores it names it, from the top level and sorted by name, with a
62
+ trailing `/` on a directory. A `__pycache__` pattern lists
63
+ `src/pkg/__pycache__/`, where the disclosure read the tracked `src/` as
64
+ ignored and unrecoverable. A pattern for a directory's contents, such as
65
+ `path/to/ignored/*`, lists that directory once. The disclosure ends with a
66
+ `git -C PATH ls-files --others --ignored --exclude-standard` line that
67
+ lists every ignored file, to read before you answer.
68
+
69
+ A branch whose pull request was stacked on another branch read as `unknown`,
70
+ "the request targeted a different branch", after the forge landed it on the
71
+ head branch. `gw prune`, `gw remove`, `gw branch status`, `gw branch prune`
72
+ and `gw fast-forward` now count such a request as proof when its merge
73
+ commit is on the head branch's first-parent history, and the reason names
74
+ the branch it targeted.
75
+
76
+ `gw fast-forward` takes GitHub's rewrite of a stacked pull request's
77
+ branch instead of replaying the same commits locally, so the push after
78
+ it no longer overwrites GitHub's commits and `--force-if-includes` no
79
+ longer refuses it. Run straight after the pull request below merges, it
80
+ waits up to a minute for that rewrite. `--json` names the remote copy it
81
+ took in `adopted`.
82
+
83
+ `gw list` and `gw l` list worktrees without syncing first: they no longer
84
+ fetch every remote and query the forge when a sync is due, and print no
85
+ `Head:`, `Last sync:` or `Never synced:` line. `gw list --json` still
86
+ carries `head` and `lastSync` from the last sync.
87
+
88
+ `/worktrees:ship-it` writes the release note with `release:write` when the
89
+ `release` plugin is installed. It looked for the `release-notes` plugin,
90
+ which `release` replaced, so it skipped the note.
91
+
20
92
  ## 0.9.0 - 2026-11-09
21
93
 
22
94
  ### Removed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: git-worktrees
3
- Version: 0.9.0
3
+ Version: 0.10.0
4
4
  Summary: Git worktree commands that refuse to lose work.
5
5
  Project-URL: Bug reports, https://github.com/MihaiBojin/worktrees/issues/new
6
6
  Project-URL: Source, https://github.com/MihaiBojin/worktrees
@@ -40,7 +40,7 @@ gw remove fix-parser # remove one worktree and its finished branch
40
40
  ```
41
41
 
42
42
  `gw sync` fetches every remote and asks the forge about each local branch.
43
- Every other command but `gw version`, `gw ci-checks`, help and completion
43
+ Every other command but `gw version`, `gw ci-checks`, `gw merge`, help and completion
44
44
  runs it first once the last sync is a minute old, then works from local refs
45
45
  and that sync's evidence. `gw ci-checks` reads a pull request's checks from
46
46
  the forge each time it runs. With `WORKTREES_OFFLINE` set, nothing touches
@@ -60,6 +60,7 @@ repositories under the same worktree root are outside their scope.
60
60
  | `gw add NAME [BASE]` | `gwa` | create or enter a worktree |
61
61
  | `gw branch create NAME` | `gwbc` | start a branch from the assessed head ref |
62
62
  | `gw fast-forward [NAME]` | `gwff` | rebase this branch onto the head ref, or move a merged one, and what came after its merge, to a new branch |
63
+ | `gw merge NUMBER --match-head-commit SHA` | | squash one checked GitHub PR, respecting native stacks and merge queues |
63
64
  | `gw ci-checks [NUMBER]` | | read a pull request's checks from GitHub or GitLab; `gw ci` for short |
64
65
  | `gw version` | | print the installed version |
65
66
 
@@ -103,7 +104,7 @@ the plugin's tag to the same release, as each manager below describes.
103
104
  ### fish
104
105
 
105
106
  ```console
106
- fisher install MihaiBojin/worktrees@v0.9.0
107
+ fisher install MihaiBojin/worktrees@v0.10.0
107
108
  ```
108
109
 
109
110
  Fisher copies `functions/`, `completions/` and `conf.d/` from the repository
@@ -120,7 +121,7 @@ the untagged one holds the files.
120
121
  Antidote takes a `path:` into the repository, and `branch:` takes a tag:
121
122
 
122
123
  ```
123
- MihaiBojin/worktrees branch:v0.9.0 path:zsh/plugins/worktrees # in zsh_plugins.txt
124
+ MihaiBojin/worktrees branch:v0.10.0 path:zsh/plugins/worktrees # in zsh_plugins.txt
124
125
  ```
125
126
 
126
127
  The plugin puts its own `functions/` and `completions/` on `fpath` and
@@ -195,8 +196,8 @@ its stdout stays the version alone for a script to read.
195
196
  An excerpt of `gw --help`'s release lines with matching CLI and shell releases:
196
197
 
197
198
  ```console
198
- worktrees 0.9.0: git worktree commands that refuse to lose work
199
- The shell plugin here is 0.9.0, the same release as these commands.
199
+ worktrees 0.10.0: git worktree commands that refuse to lose work
200
+ The shell plugin here is 0.10.0, the same release as these commands.
200
201
  ```
201
202
 
202
203
  A shell without the variable has no plugin loaded, or one older than the
@@ -255,6 +256,10 @@ A checked-out branch appears only as its worktree, never as a loose branch.
255
256
  `empty` includes unused branches and branches merged by fast-forward without
256
257
  forge proof. Git cannot distinguish them. A verdict describes completion;
257
258
  `eligible` also checks protections and the deletion permissions you supplied.
259
+ After the table, `gw prune` lists every worktree it holds back with each
260
+ reason, and `gw remove` does the same for its target. The main checkout is
261
+ left out, since nothing removes it. The `keep` and `unknown` evidence counts
262
+ as a reason; the evidence for `remove` and `empty` does not.
258
263
 
259
264
  The CLI never deletes `main`, `master` or the head branch. It never removes
260
265
  the main checkout, locked or dirty worktrees, worktrees with untracked files,
@@ -280,7 +285,9 @@ Repeat `--delete` to combine categories:
280
285
  `gw branch status` rejects `--delete`. An unknown or unsupported value is a
281
286
  usage error before mutation. `--delete empty` changes eligibility, not the
282
287
  verdict. Ignored files have no recovery command: Git never recorded their
283
- contents.
288
+ contents. When only missing values hold worktrees back, `gw prune` names
289
+ the command that grants them, keeping the values you passed:
290
+ `gw prune --delete ignored-files makes fix-parser eligible`.
284
291
 
285
292
  ```console
286
293
  gw prune --delete empty --delete ignored-files
@@ -299,9 +306,14 @@ with it; `empty`, `stashes` and `all` are usage errors with `--keep-branch`.
299
306
 
300
307
  Before confirmation, the CLI discloses the path and branch, the branch
301
308
  restore command, stashes with their restore commands, and ignored paths it
302
- will delete. Each ignored path is cut to its first component below the
303
- `.gitignore` that ignores it, so `build/out/a.log` and `build/out/b.log` read
304
- as `build/`. Quiet, JSON and `--yes` keep this disclosure on stderr.
309
+ will delete, sorted by name. Each ignored path reads as the pattern that
310
+ ignores it names it, from the top level, with a trailing `/` on a
311
+ directory: `__pycache__` lists `src/pkg/__pycache__/`, never the tracked
312
+ `src/` above it. A pattern for a directory's contents, such as
313
+ `path/to/ignored/*`, lists that directory once as `path/to/ignored/`.
314
+ Below the list, `git -C PATH ls-files --others --ignored --exclude-standard`
315
+ lists every ignored file, for you to read before answering.
316
+ Quiet, JSON and `--yes` keep this disclosure on stderr.
305
317
  It repeats the assessment after confirmation and refuses changed targets.
306
318
  Ignored directory entries can cover a whole directory; the recheck compares
307
319
  Git's ignored path listing, not a fingerprint of every file's contents.
@@ -388,9 +400,9 @@ branch and source tip. Sync replaces it atomically. Changing the remote's
388
400
  name or URL invalidates it. Malformed or mismatched evidence proves nothing.
389
401
  A moved branch needs another sync for forge evidence; local proof still works.
390
402
 
391
- Every command except `gw sync`, `gw version`, `gw fast-forward`, help and
392
- completion syncs first when the default remote's refs have never synced or
393
- last synced 60 seconds ago or more. `WORKTREES_SYNC_TTL` sets that window in whole seconds, and `0`
403
+ Every command except `gw sync`, `gw version`, `gw list`, `gw fast-forward`,
404
+ help and completion syncs first when the default remote's refs have never
405
+ synced or last synced 60 seconds ago or more. `WORKTREES_SYNC_TTL` sets that window in whole seconds, and `0`
394
406
  syncs before every command. The forge time does not count, so a forge that
395
407
  keeps failing does not make every command sync. A failed sync warns, `-q` and
396
408
  `--json` hide the warning, and the command goes on with the evidence it had.
@@ -462,7 +474,15 @@ its name and drops the merged commits in place. `--autostash` carries uncommitte
462
474
  already level exits 0 and changes nothing. [Fast-forward](docs/commands/fast-forward.md) gives the
463
475
  order of the checks, the JSON and the conflict loop.
464
476
 
465
- ## Pull request checks
477
+ ## Pull request checks and merges
478
+
479
+ [`gw merge`](docs/commands/merge.md) squashes one GitHub PR at its checked
480
+ head SHA, including native stacked PRs. It waits up to ten minutes for lower
481
+ stack members and the head rewrite, and respects the merge queue. A rewritten
482
+ head returns `head-moved` at exit 4 without submitting. Submitted operations
483
+ report `merged`, `enqueued`, `pending` or `failed`. The ship-it skill in
484
+ Codex and Claude uses this command; both the CLI and plugin must be updated
485
+ to provide it.
466
486
 
467
487
  `gw ci-checks`, or `gw ci` for short, reads one pull request, or GitLab merge
468
488
  request, and its checks: the current branch's, or the one `NUMBER` names. It
@@ -481,12 +501,15 @@ read, so read again. Each check carries `name`, `workflow`, the forge's own
481
501
  `state`, a `bucket` of `pass`, `fail`, `cancel`, `pending`, `skipping`,
482
502
  `blocked` or `unknown`, and a `link` to its log. `pr` holds the review's
483
503
  number, URL, state, draft flag, head and base, and its mergeability as the
484
- forge reports it. `passed` describes the checks, not whether the forge will
485
- merge: a required review still blocks it.
486
-
487
- GitHub answers in one `gh pr view`, so the review and its checks describe
488
- the same head; a re-run replaces the run it repeats. GitLab reads the merge
489
- request's head pipeline from the project that ran it, and reads the merge
504
+ forge reports it. `pr.trailers` holds the commits' trailers once each,
505
+ oldest commit first, or null when the complete list is unavailable.
506
+ [CI checks](docs/commands/ci-checks.md) describes the trailer limits.
507
+ `passed` describes the checks, not whether the forge will merge: a required
508
+ review still blocks it.
509
+
510
+ GitHub answers in one `gh pr view`, so the commit messages and checks
511
+ describe the same head; a re-run replaces the run it repeats. GitLab reads
512
+ the merge request's head pipeline from the project that ran it, and reads the merge
490
513
  request again afterwards. A pipeline for an older head is stale, unless it is
491
514
  a merged-result pipeline whose parents are the current head and the target's
492
515
  current tip.
@@ -520,6 +543,7 @@ parseable. Passing both is a usage error.
520
543
  | `gw branch status` | yes | no |
521
544
  | `gw list`, `gw select-main` | no | no |
522
545
  | `gw ci-checks` | no | yes |
546
+ | `gw merge` | no | yes |
523
547
 
524
548
  Other commands retain their own flags; use `--help`. Help, version and
525
549
  completion work without an assessment. `--only` filters assessment verdicts