git-worktrees 0.11.2__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.
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/.github/workflows/publish.yml +147 -3
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/AGENTS.md +121 -5
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/CHANGELOG.md +65 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/PKG-INFO +83 -16
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/README.md +82 -15
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/conf.d/worktrees.fish +1 -1
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/docs/DEVELOPMENT.md +35 -2
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/docs/REFERENCE.md +222 -4
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/docs/commands/fast-forward.md +56 -6
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/docs/commands/merge.md +10 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/.claude-plugin/plugin.json +1 -1
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/.codex-plugin/plugin.json +1 -1
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/plugin.json +1 -1
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/skills/fast-forward/SKILL.md +11 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/skills/ship-it/SKILL.md +19 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/pyproject.toml +1 -1
- git_worktrees-0.12.1/src/worktrees/audit.py +473 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/branch_cli.py +26 -16
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/branch_forge.py +50 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/branches.py +28 -4
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/cli.py +272 -58
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/fast_forward.py +360 -26
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/forge.py +26 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/git.py +30 -3
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/merged.py +161 -1
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/pr_merge.py +49 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/prune.py +230 -18
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/render.py +124 -1
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/repo.py +32 -20
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/verdicts.py +24 -3
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/worktree.py +71 -15
- git_worktrees-0.12.1/tests/audit_schema.py +264 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/conftest.py +25 -1
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_assessment.py +117 -5
- git_worktrees-0.12.1/tests/test_audit.py +1119 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_branches.py +9 -6
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_cli.py +147 -34
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_fast_forward.py +388 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_gates.py +6 -2
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_partial_clone.py +2 -1
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_pr_merge.py +67 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_removal.py +30 -4
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_render.py +76 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_worktree.py +1 -1
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/uv.lock +1 -1
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/worktrees.plugin.zsh +1 -1
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/.claude/settings.json +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/.codex/config.toml +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/.github/workflows/codeql.yml +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/.github/workflows/testpypi.yml +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/.github/workflows/tests.yml +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/.gitignore +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/.pre-commit-config.yaml +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/.python-version +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/.releasetools.yaml +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/LICENSE +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/Makefile +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/completions/gw.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/completions/worktrees.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/docs/BENCHMARK.md +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/docs/commands/branch-prune.md +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/docs/commands/branch-status.md +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/docs/commands/ci-checks.md +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/docs/plans/2026-11-05-worktree-pruning-design.md +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/functions/gw.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/functions/gwa.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/functions/gwbc.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/functions/gwbp.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/functions/gwbs.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/functions/gwff.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/functions/gwl.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/functions/gwm.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/functions/gwp!.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/functions/gwp.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/functions/gwpa!.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/functions/gwpa.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/functions/gwr!.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/functions/gwr.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/functions/gws.fish +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/hatch_build.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/README.md +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/hooks/codex.json +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/hooks/hooks.json +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/session.md +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/skills/ci-checks/SKILL.md +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/skills/describe-pr/SKILL.md +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/skills/describe-pr/format.md +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/skills/preflight/SKILL.md +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/skills/preflight/agents/openai.yaml +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/skills/preflight/rules.json +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/skills/prune/SKILL.md +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/plugin/skills/ship-it/rights.md +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/renovate.json +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/scripts/README.md +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/scripts/benchmark.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/scripts/bump_version.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/scripts/verify-publish.bash +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/__init__.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/ci.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/errors.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/layout.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/new_branch.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/pick.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/progress.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/src/worktrees/sync.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_benchmark.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_branch_forge.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_ci.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_command_defaults.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_completions.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_fixture.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_forge.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_git_records.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_new_branch.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_path_boundaries.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_plugin.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_shims.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_spec.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_sync.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/tests/test_version.py +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/completions/_gw +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gw +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwa +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwbc +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwbp +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwbs +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwff +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwl +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwm +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwp +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwp! +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwpa +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwpa! +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwr +0 -0
- {git_worktrees-0.11.2 → git_worktrees-0.12.1}/zsh/plugins/worktrees/functions/gwr! +0 -0
- {git_worktrees-0.11.2 → 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
|
|
26
|
-
#
|
|
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"
|
|
@@ -137,9 +137,22 @@ command under `WORKTREES_OFFLINE=1`.
|
|
|
137
137
|
|
|
138
138
|
A branch whose open request targets another branch with an open request,
|
|
139
139
|
a stacked one, is levelled with that branch instead of the head ref:
|
|
140
|
-
`fast_forward.
|
|
140
|
+
`fast_forward._stack` reads both requests from the forge in the same
|
|
141
141
|
run, and the branch below levels with the head ref in its own run.
|
|
142
142
|
|
|
143
|
+
When the request below merged instead and its branch was kept, the forge
|
|
144
|
+
leaves the open request on that finished branch, where a merge never
|
|
145
|
+
reaches the head branch. `_retarget` moves its base to the head branch,
|
|
146
|
+
the one forge write `gw fast-forward` makes on its own, and `_publish`
|
|
147
|
+
pushes the branch under a lease once it is level; a branch with an open
|
|
148
|
+
request that dropped a parent's merged commits is pushed the same way.
|
|
149
|
+
Commits the finished branch gained after its merge that the head ref
|
|
150
|
+
lacks, by `merged.change_in`, go first: `_rescue` copies them without a
|
|
151
|
+
checkout onto a dated branch from the head ref, pushes it and opens its
|
|
152
|
+
request, and a copy that cannot be made leaves the base where it is.
|
|
153
|
+
`gw merge` refuses a base that stands at a merged request's head commit,
|
|
154
|
+
so a run that skipped this still cannot land there.
|
|
155
|
+
|
|
143
156
|
Every other branch keeps its name. One with no commits of its own
|
|
144
157
|
fast-forwards and one with commits is rebased, both with `--no-autostash`
|
|
145
158
|
unless `--autostash` is given: `merge.autoStash` and `rebase.autoStash`
|
|
@@ -226,8 +239,9 @@ of rules writes both. `tests/test_plugin.py` holds every skill's
|
|
|
226
239
|
`allowed-tools` to reads, `gw sync` and `gw branch create`: no pattern
|
|
227
240
|
covers a removal, a merge, a push, a rerun or a checkout that moves. Three
|
|
228
241
|
exceptions are each skill's job: `describe-pr` may edit a review,
|
|
229
|
-
`fast-forward` runs `gw fast-forward
|
|
230
|
-
|
|
242
|
+
`fast-forward` runs `gw fast-forward`, which moves a base left on a merged
|
|
243
|
+
branch and pushes the branch it levelled, and the conflict loop its own
|
|
244
|
+
test lists, and `ship-it`, invoked to publish one change or the reviews it
|
|
231
245
|
names, commits, pushes, opens and edits the review, reruns CI and merges,
|
|
232
246
|
as its own test lists. None pre-approves a removal.
|
|
233
247
|
|
|
@@ -410,6 +424,20 @@ Padding runs on the text and painting after it. The other order counts an
|
|
|
410
424
|
escape sequence as width, and every column under a coloured cell sits crooked
|
|
411
425
|
by exactly the length of the code.
|
|
412
426
|
|
|
427
|
+
An assessment prints `render.records`, not `render.table`: a box with one
|
|
428
|
+
record a worktree or branch, a line of short cells and then its reasons
|
|
429
|
+
across the box, so a reason has the terminal's width and not a last column's.
|
|
430
|
+
A reason that is a string is prose and wraps to `render.columns`; one that is
|
|
431
|
+
a `Cell` is a command or a path and is never broken, widening the box when it
|
|
432
|
+
must, so it pastes back. `prune.details` builds them from the row's `Fact`s:
|
|
433
|
+
the evidence, each protection, each of a fact's commands on its own line,
|
|
434
|
+
and `needs:` once, last. The JSON `protections` keep the one-line wording
|
|
435
|
+
with `; pass --delete ...`, which the prune skill reads. The worktree's path
|
|
436
|
+
is in `--json` and the removal disclosure, not in the box. `render.ruled`
|
|
437
|
+
picks box characters for a UTF-8 terminal and `+`, `-` and `|` otherwise;
|
|
438
|
+
`--table` sets `render.plain`, which turns both wrapping and box characters
|
|
439
|
+
off, since a script reads it.
|
|
440
|
+
|
|
413
441
|
stdout carries the path `cd $(gw add x)` reads and the JSON `jq` parses, so a
|
|
414
442
|
redirect, a pipe, a non-empty `NO_COLOR`, or `TERM=dumb` mean the bytes go out
|
|
415
443
|
as they would have without the module. `NO_COLOR=` is not a request to turn it
|
|
@@ -517,6 +545,18 @@ git process whose work is the CPU's, so more threads than cores only queue
|
|
|
517
545
|
behind each other and the interpreter lock; `sync` keeps eight, since its
|
|
518
546
|
threads wait on the network. Mutations remain serial.
|
|
519
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
|
+
|
|
520
560
|
An assessment asks every worktree the same questions about the head, so
|
|
521
561
|
`merged.reuse()` keeps the answers that name objects by full SHA for the
|
|
522
562
|
length of one `assess`: a commit's tree, a merge base, the patch-ids of the
|
|
@@ -524,6 +564,18 @@ head's commits after a fork point. Those are facts about the objects. Nothing
|
|
|
524
564
|
outside an assessment keeps them, since `gw fast-forward` fetches and an
|
|
525
565
|
object missing a moment ago can appear, and a failed answer is never kept.
|
|
526
566
|
|
|
567
|
+
Two of those answers outlive the run: `_local_proof` for a tip and
|
|
568
|
+
`change_in` for a reflog commit, each against the head's full SHA, saved in
|
|
569
|
+
`git-worktrees-proofs.json` in the Git common directory and replaced
|
|
570
|
+
atomically when the assessment ends. They have no TTL, since neither commit
|
|
571
|
+
changes; the file holds one head's answers and starts again when the head
|
|
572
|
+
moves, which bounds it. A partial clone saves only a yes, because a fetch
|
|
573
|
+
can bring the object a no lacked without moving the head, and an entry that
|
|
574
|
+
is not the shape `merged.py` wrote is asked again. Nothing a checkout holds
|
|
575
|
+
is saved: `git status`, submodules, an operation in progress, reflogs and
|
|
576
|
+
stashes are read on every run, since they are what stops a worktree with
|
|
577
|
+
work in it being offered.
|
|
578
|
+
|
|
527
579
|
`git submodule status` is the costliest check, so the store decides alone
|
|
528
580
|
when it exists, and without one the check runs only where `.gitmodules`
|
|
529
581
|
exists. The store outlives a deleted `.gitmodules`, which is also when
|
|
@@ -545,6 +597,67 @@ pipeline whose parents
|
|
|
545
597
|
are the current head and the target's tip. `ci.wait` takes its clock and
|
|
546
598
|
sleep as arguments, so its tests run in-process without waiting.
|
|
547
599
|
|
|
600
|
+
## The audit log is appended, never edited
|
|
601
|
+
|
|
602
|
+
`audit.py` writes one JSON line per event to `audit-YYYY-MM.jsonl` under
|
|
603
|
+
`$XDG_STATE_HOME/worktrees`, or `WORKTREES_AUDIT_DIR`. Each line is one
|
|
604
|
+
`os.write` on an `O_APPEND` descriptor, and nothing here seeks, truncates,
|
|
605
|
+
renames or deletes a file. A monthly name is what makes that hold: rotation
|
|
606
|
+
by size would need a rename.
|
|
607
|
+
|
|
608
|
+
Recording runs between `audit.begin` and `audit.end`. `_dispatch` begins
|
|
609
|
+
once argparse has the words, so `--help`, which leaves inside `parse_args`,
|
|
610
|
+
and a parsed `--explain` or `--complete` on any subcommand record nothing
|
|
611
|
+
and answer under a `WORKTREES_AUDIT` it does not take; no scan of the raw
|
|
612
|
+
words would know an abbreviated `--hel` or a value after `--`. A usage
|
|
613
|
+
error begins in `main`, as it leaves. Every path from `main` to `_command`
|
|
614
|
+
is inside the `try` whose `finally` ends the run, so no start lacks its end. Outside the pair every
|
|
615
|
+
function returns at once, so a test or a caller that imports the package
|
|
616
|
+
and runs a spec writes nothing.
|
|
617
|
+
|
|
618
|
+
A line is one `os.write` and is never resumed: after a short write
|
|
619
|
+
`_append` closes the fragment with a newline if one fits and raises. Each
|
|
620
|
+
append takes `flock`, reads the last byte and writes under it, and a file
|
|
621
|
+
that does not end in a newline gets one before the line, which carries
|
|
622
|
+
`torn`. What the file ended in at open is never kept: another process can
|
|
623
|
+
tear a line after that, and a look outside the lock races the write. The
|
|
624
|
+
lock is tried for a tenth of a second; without it the line brings its own
|
|
625
|
+
newline whatever the file ends in.
|
|
626
|
+
|
|
627
|
+
Two places see every process: the `@git` wrapper and `forge._run`. Each
|
|
628
|
+
times the run and calls `audit.ran`, filed as `reads`, `mutating` or
|
|
629
|
+
`forge`; `WORKTREES_AUDIT` turns each off by name and `off` turns off the
|
|
630
|
+
log. A spec holding `fetch` is filed as mutating though it is not declared
|
|
631
|
+
`mutates`. What a process printed is kept only when it changes something or
|
|
632
|
+
failed. `audit.clean` walks the whole event as `record` serializes it and
|
|
633
|
+
scrubs every string, so no caller scrubs its own fields and none can forget.
|
|
634
|
+
|
|
635
|
+
`prune.audit_proposed` runs in `prune.plan` and `prune.audit_outcome` after
|
|
636
|
+
`worktree.remove` and `branches.delete`, the second also when the recheck
|
|
637
|
+
refuses. `prune.restores` builds one action per thing taken, with its kind,
|
|
638
|
+
full sha, branch or subject and an unquoted `argv`; `command` and `undo` are
|
|
639
|
+
`shlex.join` of that, so the line a person pastes cannot disagree with the
|
|
640
|
+
fields a program reads. A proposal passes only what would go and an outcome
|
|
641
|
+
only what went, so a kept or retained branch, and its stashes, have none. They ask git for the remote
|
|
642
|
+
only while the log is on. `Moved` carries short shas, so `_audit_moved`
|
|
643
|
+
resolves both ends before it writes one.
|
|
644
|
+
|
|
645
|
+
`tests/audit_schema.py` lists every event's fields, types and values, and
|
|
646
|
+
`events()` in `tests/test_audit.py` holds each event a test reads to it: an
|
|
647
|
+
unlisted field, a missing one or another type fails. The reference is held
|
|
648
|
+
to the same names. `audit.clean` raises on a type it does not know, so a
|
|
649
|
+
new field of an odd type drops its event with a warning; nothing is ever
|
|
650
|
+
written as a Python repr. A failure's kind and a removal's stage are fields
|
|
651
|
+
of their own, `failure` and `failedStage`. A handler in `cli.py` that prints
|
|
652
|
+
a refusal and returns goes through `_refuse`, which hands the kind to the
|
|
653
|
+
log; one that only printed would end its run as `result`. A cut output
|
|
654
|
+
carries its count in `outDropped`, never a mark inside the text.
|
|
655
|
+
|
|
656
|
+
A write that fails turns recording off for the rest of the run and warns
|
|
657
|
+
once through `progress.line`. `conftest.ENV` and an autouse fixture set
|
|
658
|
+
`WORKTREES_AUDIT=off`; `tests/test_audit.py` turns it on at a directory of
|
|
659
|
+
its own. [Audit log](docs/REFERENCE.md#audit-log) lists the events.
|
|
660
|
+
|
|
548
661
|
## Every git command is one spec
|
|
549
662
|
|
|
550
663
|
The spec is the command as you would type it, with `$name` where a value goes.
|
|
@@ -612,7 +725,9 @@ both ways was 18 of an assessment's 35 calls over nine worktrees.
|
|
|
612
725
|
no call site can assemble its way past it. `reset --hard`, a forced `checkout`
|
|
613
726
|
or `switch`, `clean -f`, a bare `push --force`, `worktree remove --force`,
|
|
614
727
|
`branch -D` and an `update-ref` delete that names no full sha are refused
|
|
615
|
-
absolutely. There is no flag, and `--yes` least of all.
|
|
728
|
+
absolutely. There is no flag, and `--yes` least of all. `gw remove` prints
|
|
729
|
+
`git worktree remove --force PATH` beside a dirty target's refusal, for a
|
|
730
|
+
person who has looked to run; nothing here runs it.
|
|
616
731
|
|
|
617
732
|
Those seven are `RULES`, a tuple, each row carrying the name `--explain`
|
|
618
733
|
prints, the clause the refusal ends with, and the test. The footer `--explain`
|
|
@@ -707,4 +822,5 @@ directory too, since `GIT_CONFIG_GLOBAL` does not reach `git/ignore`, the
|
|
|
707
822
|
default `core.excludesFile`. `WORKTREES_OFFLINE=1` in `conftest.ENV` stops
|
|
708
823
|
a command syncing first, which would fetch a remote at `github.com` for
|
|
709
824
|
real. `Network.env` clears it for the fake network, and `conftest.online`
|
|
710
|
-
for a remote on disk.
|
|
825
|
+
for a remote on disk. The fake network's git answers `push` itself, as it
|
|
826
|
+
does `fetch`, and its `gh` and `glab` answer an edit and a create.
|
|
@@ -17,6 +17,71 @@ 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
|
+
|
|
32
|
+
## 0.12.0 - 2026-11-16
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
`gw prune`, `gw remove` and `gw branch status` print each worktree or
|
|
37
|
+
branch as a record in a box: one line with BRANCH, VERDICT, REASON and
|
|
38
|
+
ELIGIBLE, then its reasons across the full width, wrapped to the
|
|
39
|
+
terminal. The PATH and WORKTREE columns are gone, from `--table` too,
|
|
40
|
+
which draws the box with `+`, `-` and `|` and wraps nothing. A script
|
|
41
|
+
that parsed those columns should read `--json`, whose `why` and
|
|
42
|
+
`protections` keep their wording.
|
|
43
|
+
|
|
44
|
+
A command inside a reason, such as `git show SHA`, gets a line of its own
|
|
45
|
+
and is never broken, and the `--delete` values a row needs are named once,
|
|
46
|
+
as `needs:`. The hint for missing `--delete` values prints its command on
|
|
47
|
+
a line of its own with the worktrees it frees listed under it, and the
|
|
48
|
+
removal disclosure puts each restore and listing command on its own line,
|
|
49
|
+
with a blank line between targets.
|
|
50
|
+
|
|
51
|
+
A dirty worktree's reason says what `git status` found, such as
|
|
52
|
+
`it has uncommitted changes to 9 files and 1 untracked path`, in place
|
|
53
|
+
of `it has uncommitted changes or untracked files`, in tables and in
|
|
54
|
+
the JSON `why` and `protections`. Scripts matching the old text should
|
|
55
|
+
read `reason`, which stays `uncommitted`. The `--delete` help names
|
|
56
|
+
each value beside what it permits.
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
|
|
60
|
+
When `gw remove` keeps a worktree, it names the full command that
|
|
61
|
+
removes it: `gw remove PATH --delete VALUE`, carrying the values you
|
|
62
|
+
passed, as `gw prune` names its own. For uncommitted changes or
|
|
63
|
+
untracked paths it names `git worktree remove --force PATH`, with a
|
|
64
|
+
count of the ignored paths and reflog-only commits that command
|
|
65
|
+
deletes and the branch it keeps; gw never runs it.
|
|
66
|
+
|
|
67
|
+
Every command appends what it ran to an audit log,
|
|
68
|
+
`~/.local/state/worktrees/audit-YYYY-MM.jsonl`: each `git`, `gh` and
|
|
69
|
+
`glab` process with its exit code and duration, and each removal with
|
|
70
|
+
what restores it, as fields and as commands to paste.
|
|
71
|
+
`WORKTREES_AUDIT=off` turns it off, `WORKTREES_AUDIT=reads=off` leaves out
|
|
72
|
+
read-only git commands, and `WORKTREES_AUDIT_DIR` moves it.
|
|
73
|
+
|
|
74
|
+
`gw fast-forward` now moves a pull request left on a merged parent's
|
|
75
|
+
branch to the head branch, pushes the levelled branch under a lease, and
|
|
76
|
+
opens a separate request for commits the parent gained after its merge.
|
|
77
|
+
`gw merge` refuses a base left on a merged branch.
|
|
78
|
+
|
|
79
|
+
An assessment saves each worktree's completion proof in
|
|
80
|
+
`git-worktrees-proofs.json` in the Git common directory, so the next
|
|
81
|
+
`gw prune`, `gw remove` or `gw branch status` against the same head
|
|
82
|
+
commit reads it instead of asking git again. What a checkout holds is
|
|
83
|
+
still read on every run.
|
|
84
|
+
|
|
20
85
|
## 0.11.2 - 2026-11-15
|
|
21
86
|
|
|
22
87
|
### Removed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: git-worktrees
|
|
3
|
-
Version: 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.
|
|
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.
|
|
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.
|
|
200
|
-
The shell plugin here is 0.
|
|
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
|
|
@@ -272,12 +272,40 @@ Deleting a branch deletes its reflog, and removing a worktree deletes the
|
|
|
272
272
|
worktree's own. A commit nothing else reaches goes with them, so a row whose
|
|
273
273
|
deleted reflogs hold a commit whose patch the head lacks is held back, and
|
|
274
274
|
the protection names `git show SHA` for each one. `eligible` also checks
|
|
275
|
-
protections and the deletion permissions you supplied.
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
275
|
+
protections and the deletion permissions you supplied.
|
|
276
|
+
|
|
277
|
+
The table is a box with one record for each worktree: a line of short
|
|
278
|
+
answers, then the reasons across the full width, wrapped to the terminal.
|
|
279
|
+
|
|
280
|
+
```
|
|
281
|
+
┌───────────────┬─────────┬────────┬──────────────────────┐
|
|
282
|
+
│ BRANCH │ VERDICT │ REASON │ ELIGIBLE │
|
|
283
|
+
├───────────────┼─────────┼────────┼──────────────────────┤
|
|
284
|
+
│ release-0.8.0 │ keep │ closed │ no │
|
|
285
|
+
├───────────────┴─────────┴────────┴──────────────────────┤
|
|
286
|
+
│ pull request #182 was closed without merging this tip │
|
|
287
|
+
│ its request is closed │
|
|
288
|
+
│ its reflog alone holds 2 commits the head branch lacks; │
|
|
289
|
+
│ see each with: │
|
|
290
|
+
│ git show 54a199e1f797 │
|
|
291
|
+
│ git show ea8faa8208f5 │
|
|
292
|
+
│ needs: --delete closed --delete reflog │
|
|
293
|
+
└─────────────────────────────────────────────────────────┘
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
The reasons are the evidence, then each protection that stands, a command
|
|
297
|
+
on a line of its own so it is never cut. `needs:` ends a record with every
|
|
298
|
+
`--delete` value it needs, and only where those values make it eligible.
|
|
299
|
+
The path is in `--json`, not in the table. Off a terminal and under
|
|
300
|
+
`--table` the box is drawn with `+`, `-` and `|` and nothing wraps. In
|
|
301
|
+
`--json`, a protection those values lift ends with them, such as
|
|
302
|
+
`pass --delete empty --delete stashes`. For a target it keeps, `gw remove` prints every reason and
|
|
303
|
+
each command that removes it: `gw remove PATH --delete VALUE`, carrying the
|
|
304
|
+
values you passed, as `gw prune` names them; `--keep-branch` when only that
|
|
305
|
+
waives the proof; and, for uncommitted changes or untracked paths,
|
|
306
|
+
`git worktree remove --force PATH`, which deletes the checkout with them and
|
|
307
|
+
keeps the branch. That line counts the ignored paths and reflog-only commits
|
|
308
|
+
that go too. gw never runs it.
|
|
281
309
|
|
|
282
310
|
The CLI never deletes `main`, `master` or the head branch. It never removes
|
|
283
311
|
the main checkout, locked or dirty worktrees, worktrees with untracked files,
|
|
@@ -303,9 +331,20 @@ Repeat `--delete` to combine categories:
|
|
|
303
331
|
|
|
304
332
|
`gw branch status` rejects `--delete`. An unknown or unsupported value is a
|
|
305
333
|
usage error before mutation. A `--delete` value changes eligibility, not the
|
|
306
|
-
verdict. When only missing values hold worktrees back, `gw prune`
|
|
307
|
-
the command that grants them, keeping the
|
|
308
|
-
|
|
334
|
+
verdict. When only missing values hold worktrees back, `gw prune` says so
|
|
335
|
+
and prints the command that grants them on a line of its own, keeping the
|
|
336
|
+
values you passed, then the worktrees it frees. The command takes no names;
|
|
337
|
+
`gw remove NAME` targets one worktree.
|
|
338
|
+
|
|
339
|
+
```
|
|
340
|
+
→ 2 worktrees are held back only by a permission. To make them eligible, run:
|
|
341
|
+
|
|
342
|
+
gw prune --delete closed --delete reflog
|
|
343
|
+
|
|
344
|
+
frees: gw-design, release-0.8.0
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
Without a terminal,
|
|
309
348
|
the line that names `--yes` carries the `--delete` values and
|
|
310
349
|
`--keep-branch` you passed, so running it removes what was counted.
|
|
311
350
|
|
|
@@ -339,6 +378,10 @@ Below the list, `git -C PATH ls-files --others --ignored --exclude-standard`
|
|
|
339
378
|
lists every ignored file, for you to read before answering.
|
|
340
379
|
Quiet, JSON and `--yes` keep this disclosure on stderr.
|
|
341
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.
|
|
342
385
|
Ignored directory entries can cover a whole directory; the recheck compares
|
|
343
386
|
Git's ignored path listing, not a fingerprint of every file's contents.
|
|
344
387
|
|
|
@@ -493,7 +536,11 @@ moves to a new branch from the head ref or `--from`, named
|
|
|
493
536
|
`YYYY-MM-DDThh-mm-ssZ/NAME` unless you name it. A branch whose own pull
|
|
494
537
|
request squash-merged its first commits moves the same way, carrying only
|
|
495
538
|
the commits made after the merge; a stacked branch whose parent merged keeps
|
|
496
|
-
its name and drops the merged commits in place.
|
|
539
|
+
its name and drops the merged commits in place. When that branch's open
|
|
540
|
+
request still targets the merged parent, which a forge leaves there unless
|
|
541
|
+
the parent's branch is deleted, the run moves its base to the head branch
|
|
542
|
+
and pushes the branch under a lease; commits the parent gained after its
|
|
543
|
+
merge get a branch and a request of their own first. `--autostash` carries uncommitted changes across. A branch
|
|
497
544
|
already level exits 0 and changes nothing. [Fast-forward](docs/commands/fast-forward.md) gives the
|
|
498
545
|
order of the checks, the JSON and the conflict loop.
|
|
499
546
|
|
|
@@ -502,7 +549,8 @@ order of the checks, the JSON and the conflict loop.
|
|
|
502
549
|
[`gw merge`](docs/commands/merge.md) squashes one GitHub PR at its checked
|
|
503
550
|
head SHA, including native stacked PRs. It waits up to ten minutes for lower
|
|
504
551
|
stack members and the head rewrite, and respects the merge queue. A rewritten
|
|
505
|
-
head returns `head-moved` at exit 4 without submitting.
|
|
552
|
+
head returns `head-moved` at exit 4 without submitting. A base left on a
|
|
553
|
+
branch whose own PR merged is refused, and `gw fast-forward` moves it. Submitted operations
|
|
506
554
|
report `merged`, `enqueued`, `pending` or `failed`. The ship-it skill in
|
|
507
555
|
Codex and Claude uses this command; both the CLI and plugin must be updated
|
|
508
556
|
to provide it.
|
|
@@ -594,6 +642,25 @@ gw prune --json | jq '.verdicts[] | select(.eligible)'
|
|
|
594
642
|
gw list --json | jq -r '.worktrees[].path'
|
|
595
643
|
```
|
|
596
644
|
|
|
645
|
+
## Audit log
|
|
646
|
+
|
|
647
|
+
Each command appends what it did, one JSON object per line, to
|
|
648
|
+
`~/.local/state/worktrees/audit-YYYY-MM.jsonl`: the command as typed, every
|
|
649
|
+
`git`, `gh` and `glab` process with its exit code and duration, and each
|
|
650
|
+
removal with the full SHA and what restores it, as fields and as commands
|
|
651
|
+
to paste. Lines are only ever appended, and no file is ever deleted.
|
|
652
|
+
|
|
653
|
+
```console
|
|
654
|
+
$ jq -c 'select(.event == "removal.outcome") | {ts, host, branch, result, restore}' \
|
|
655
|
+
~/.local/state/worktrees/audit-*.jsonl
|
|
656
|
+
$ jq -c 'select(.event == "exec" and .mutates) | {ts, ms, code, argv}' \
|
|
657
|
+
~/.local/state/worktrees/audit-*.jsonl
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
`WORKTREES_AUDIT=reads=off` leaves out read-only git commands,
|
|
661
|
+
`WORKTREES_AUDIT=off` turns the log off, and `WORKTREES_AUDIT_DIR` moves it.
|
|
662
|
+
[The reference](docs/REFERENCE.md#audit-log) lists every event and field.
|
|
663
|
+
|
|
597
664
|
## Migration
|
|
598
665
|
|
|
599
666
|
| Removed interface | Current interface |
|