git-worktrees 0.3.1__tar.gz → 0.4.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.3.1 → git_worktrees-0.4.1}/.github/workflows/publish.yml +7 -4
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/.github/workflows/testpypi.yml +2 -1
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/.github/workflows/tests.yml +4 -2
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/CHANGELOG.md +31 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/PKG-INFO +33 -5
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/README.md +32 -4
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/docs/DEVELOPMENT.md +3 -1
- git_worktrees-0.4.1/docs/REFERENCE.md +438 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/pyproject.toml +1 -1
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/scripts/verify-publish.bash +5 -4
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/src/worktrees/cli.py +53 -12
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/src/worktrees/forge.py +9 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/src/worktrees/layout.py +37 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/src/worktrees/new_branch.py +4 -1
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/src/worktrees/prune.py +6 -1
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/tests/conftest.py +16 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/tests/test_cli.py +112 -1
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/tests/test_completions.py +45 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/tests/test_forge.py +114 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/tests/test_gates.py +31 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/tests/test_shims.py +28 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/tests/test_worktree.py +40 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/uv.lock +1 -1
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/.agents/skills/release/SKILL.md +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/.claude/settings.json +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/.gitignore +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/.pre-commit-config.yaml +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/.python-version +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/AGENTS.md +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/LICENSE +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/completions/gw.fish +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/completions/gwa.fish +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/completions/gwh.fish +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/completions/gwl.fish +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/completions/gwm.fish +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/completions/gwnb.fish +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/completions/gwp.fish +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/completions/gwr.fish +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/completions/gwrot.fish +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/completions/gws.fish +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/conf.d/worktrees.fish +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/docs/BENCHMARK.md +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/functions/gwa.fish +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/functions/gwl.fish +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/functions/gwm.fish +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/functions/gwr.fish +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/hatch_build.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/renovate.json +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/scripts/README.md +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/scripts/benchmark.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/src/worktrees/__init__.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/src/worktrees/errors.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/src/worktrees/git.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/src/worktrees/merged.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/src/worktrees/pick.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/src/worktrees/render.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/src/worktrees/repo.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/src/worktrees/rotate.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/src/worktrees/verdicts.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/src/worktrees/worktree.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/tests/test_benchmark.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/tests/test_fixture.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/tests/test_new_branch.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/tests/test_render.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/tests/test_rotate.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/tests/test_spec.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/tests/test_version.py +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/zsh/plugins/worktrees/completions/_gw +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/zsh/plugins/worktrees/completions/_gwa +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/zsh/plugins/worktrees/completions/_gwh +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/zsh/plugins/worktrees/completions/_gwl +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/zsh/plugins/worktrees/completions/_gwm +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/zsh/plugins/worktrees/completions/_gwnb +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/zsh/plugins/worktrees/completions/_gwp +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/zsh/plugins/worktrees/completions/_gwr +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/zsh/plugins/worktrees/completions/_gwrot +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/zsh/plugins/worktrees/completions/_gws +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/zsh/plugins/worktrees/functions/gwa +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/zsh/plugins/worktrees/functions/gwl +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/zsh/plugins/worktrees/functions/gwm +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/zsh/plugins/worktrees/functions/gwr +0 -0
- {git_worktrees-0.3.1 → git_worktrees-0.4.1}/zsh/plugins/worktrees/worktrees.plugin.zsh +0 -0
|
@@ -36,7 +36,7 @@ jobs:
|
|
|
36
36
|
# byte-for-byte what was tested and installed here.
|
|
37
37
|
build:
|
|
38
38
|
name: Build
|
|
39
|
-
runs-on: ubuntu-
|
|
39
|
+
runs-on: ubuntu-26.04
|
|
40
40
|
permissions:
|
|
41
41
|
contents: read
|
|
42
42
|
# Reading another workflow's runs. Without it the tests guard below
|
|
@@ -56,6 +56,7 @@ jobs:
|
|
|
56
56
|
with:
|
|
57
57
|
python-version: "3.14"
|
|
58
58
|
enable-cache: true
|
|
59
|
+
cache-suffix: ${{ github.workflow }}-${{ github.job }}
|
|
59
60
|
|
|
60
61
|
- name: Install the release tools
|
|
61
62
|
uses: releasetools/cli@v0
|
|
@@ -126,7 +127,7 @@ jobs:
|
|
|
126
127
|
|
|
127
128
|
publish:
|
|
128
129
|
name: Publish to PyPI
|
|
129
|
-
runs-on: ubuntu-
|
|
130
|
+
runs-on: ubuntu-26.04
|
|
130
131
|
needs: build
|
|
131
132
|
# Binds this job to the trusted publisher registered for `pypi`. Add a
|
|
132
133
|
# required reviewer on this environment for a manual gate before anything
|
|
@@ -144,6 +145,7 @@ jobs:
|
|
|
144
145
|
with:
|
|
145
146
|
python-version: "3.14"
|
|
146
147
|
enable-cache: true
|
|
148
|
+
cache-suffix: ${{ github.workflow }}-${{ github.job }}
|
|
147
149
|
|
|
148
150
|
- name: Download distributions
|
|
149
151
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
|
|
@@ -162,7 +164,7 @@ jobs:
|
|
|
162
164
|
# PyPI is slow rather than that the version is not out.
|
|
163
165
|
verify:
|
|
164
166
|
name: Verify it installs from PyPI
|
|
165
|
-
runs-on: ubuntu-
|
|
167
|
+
runs-on: ubuntu-26.04
|
|
166
168
|
needs: publish
|
|
167
169
|
permissions:
|
|
168
170
|
contents: read
|
|
@@ -178,13 +180,14 @@ jobs:
|
|
|
178
180
|
with:
|
|
179
181
|
python-version: "3.14"
|
|
180
182
|
enable-cache: true
|
|
183
|
+
cache-suffix: ${{ github.workflow }}-${{ github.job }}
|
|
181
184
|
|
|
182
185
|
- name: Verify it installs from PyPI
|
|
183
186
|
run: scripts/verify-publish.bash --prod
|
|
184
187
|
|
|
185
188
|
release:
|
|
186
189
|
name: Release
|
|
187
|
-
runs-on: ubuntu-
|
|
190
|
+
runs-on: ubuntu-26.04
|
|
188
191
|
needs: publish
|
|
189
192
|
permissions:
|
|
190
193
|
contents: write
|
|
@@ -28,7 +28,7 @@ permissions:
|
|
|
28
28
|
jobs:
|
|
29
29
|
snapshot:
|
|
30
30
|
name: Publish a snapshot
|
|
31
|
-
runs-on: ubuntu-
|
|
31
|
+
runs-on: ubuntu-26.04
|
|
32
32
|
# Binds this job to the trusted publisher registered for `testpypi`.
|
|
33
33
|
environment: testpypi
|
|
34
34
|
permissions:
|
|
@@ -47,6 +47,7 @@ jobs:
|
|
|
47
47
|
with:
|
|
48
48
|
python-version: "3.14"
|
|
49
49
|
enable-cache: true
|
|
50
|
+
cache-suffix: ${{ github.workflow }}-${{ github.job }}
|
|
50
51
|
|
|
51
52
|
# Epoch seconds rather than the run number: a re-run repeats the number
|
|
52
53
|
# and TestPyPI refuses the duplicate, while the clock has moved on.
|
|
@@ -23,7 +23,7 @@ concurrency:
|
|
|
23
23
|
jobs:
|
|
24
24
|
lint:
|
|
25
25
|
name: Lint
|
|
26
|
-
runs-on: ubuntu-
|
|
26
|
+
runs-on: ubuntu-26.04
|
|
27
27
|
steps:
|
|
28
28
|
- name: Checkout code
|
|
29
29
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
@@ -33,6 +33,7 @@ jobs:
|
|
|
33
33
|
with:
|
|
34
34
|
python-version: "3.14"
|
|
35
35
|
enable-cache: true
|
|
36
|
+
cache-suffix: ${{ github.workflow }}-${{ github.job }}
|
|
36
37
|
|
|
37
38
|
- name: Install dependencies
|
|
38
39
|
run: uv sync --all-extras --locked
|
|
@@ -44,7 +45,7 @@ jobs:
|
|
|
44
45
|
|
|
45
46
|
test:
|
|
46
47
|
name: Python ${{ matrix.python-version }}
|
|
47
|
-
runs-on: ubuntu-
|
|
48
|
+
runs-on: ubuntu-26.04
|
|
48
49
|
strategy:
|
|
49
50
|
# One version failing is a fact about that version, so let the others
|
|
50
51
|
# finish and say which.
|
|
@@ -66,6 +67,7 @@ jobs:
|
|
|
66
67
|
with:
|
|
67
68
|
python-version: ${{ matrix.python-version }}
|
|
68
69
|
enable-cache: true
|
|
70
|
+
cache-suffix: ${{ github.workflow }}-${{ github.job }}
|
|
69
71
|
|
|
70
72
|
- name: Install dependencies
|
|
71
73
|
# --locked fails the run on a stale uv.lock, rather than quietly
|
|
@@ -17,6 +17,37 @@ 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.4.1 - 2026-09-21
|
|
21
|
+
|
|
22
|
+
CLI behavior is unchanged from 0.4.0.
|
|
23
|
+
|
|
24
|
+
## 0.4.0 - 2026-09-21
|
|
25
|
+
|
|
26
|
+
### Security
|
|
27
|
+
|
|
28
|
+
Forge queries ignore `GH_REPO` and `GITLAB_REPO`, so a merged request in
|
|
29
|
+
another repository cannot authorize removal here.
|
|
30
|
+
|
|
31
|
+
Printed branch restoration commands and `gwnb` checkout hints quote branch
|
|
32
|
+
names so shell metacharacters are treated as part of the name.
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
`gws` reports how many worktrees under the shared `.worktrees` directory
|
|
37
|
+
belong to other repositories, with the count in `gws --json` as `neighbours`.
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
After a failed fetch, worktree assessments use local refs and skip forge
|
|
42
|
+
queries.
|
|
43
|
+
|
|
44
|
+
`gwl` and `gwr` shell completions omit paths containing newlines, which
|
|
45
|
+
cannot fit their one-row-per-line format; those worktrees remain reachable
|
|
46
|
+
by name or path.
|
|
47
|
+
|
|
48
|
+
Pressing Ctrl-C at a worktree selection or removal prompt exits with code
|
|
49
|
+
130 and no traceback. No worktree is selected or removed.
|
|
50
|
+
|
|
20
51
|
## 0.3.1 - 2026-09-20
|
|
21
52
|
|
|
22
53
|
`gws` and `gwp` list the main checkout, and `gwl`'s picker shows the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: git-worktrees
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.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
|
|
@@ -64,6 +64,10 @@ function, because a binary cannot change its caller's directory.
|
|
|
64
64
|
|
|
65
65
|
`worktrees` is the same program under its long name.
|
|
66
66
|
|
|
67
|
+
Ctrl-C interrupts a running command with exit code 130 and no traceback.
|
|
68
|
+
At a selection or removal prompt, it cancels without choosing or removing
|
|
69
|
+
a worktree.
|
|
70
|
+
|
|
67
71
|
`gws` and `gwp` are what this tool is for and their behaviour is settled.
|
|
68
72
|
|
|
69
73
|
**`gwnb` and `gwrot` are alpha and may go.** They start branches rather than
|
|
@@ -160,6 +164,12 @@ subcommand and shorthand, `gwl --complete` prints every worktree, and both
|
|
|
160
164
|
shells narrow what those return, so the matching stays in one place and a
|
|
161
165
|
command added to the table needs no edit in either shell.
|
|
162
166
|
|
|
167
|
+
One row a line, `label<TAB>path`. A worktree whose path holds a newline is
|
|
168
|
+
left out of that listing, because both shells would read it as two rows and
|
|
169
|
+
offer the tail as a worktree of its own. `gwa` cannot make such a path, since
|
|
170
|
+
it derives from a branch name and git refuses a newline in a ref, and the
|
|
171
|
+
worktree is still reachable by name or path.
|
|
172
|
+
|
|
163
173
|
Neither manager puts a binary on `$PATH`, which is why the two installs stay
|
|
164
174
|
separate.
|
|
165
175
|
|
|
@@ -175,6 +185,7 @@ unknown never-pushed not merged into origin/main, and no upstream says whethe
|
|
|
175
185
|
remove squash-merged squash-merged /home/you/git/.worktrees/squash-merged/repo
|
|
176
186
|
|
|
177
187
|
1 removable, 3 kept, 1 unclear
|
|
188
|
+
2 worktree(s) under /home/you/git/.worktrees belong to another repository
|
|
178
189
|
unclear, and gwp does not touch these: never-pushed
|
|
179
190
|
gwp removes the 1 marked removable
|
|
180
191
|
```
|
|
@@ -184,7 +195,13 @@ so the table shows what `git worktree list` shows; nothing proposes it, and
|
|
|
184
195
|
`git worktree remove` answers `fatal: '<path>' is a main working tree`
|
|
185
196
|
whatever flag it is given. Paths are absolute wherever this
|
|
186
197
|
prints one, so a row can be pasted into the next command. The table and the
|
|
187
|
-
count are on stdout;
|
|
198
|
+
count are on stdout; everything after them is on stderr.
|
|
199
|
+
|
|
200
|
+
Every repository in the same parent directory keeps its worktrees under that
|
|
201
|
+
one `.worktrees` root, so some of the directories in there are a sibling's.
|
|
202
|
+
`gws` counts those and says so, because nothing else does, and `--json`
|
|
203
|
+
carries the same count as `neighbours`. No command here reads or removes
|
|
204
|
+
them, and the count comes from walking the root rather than from asking git.
|
|
188
205
|
|
|
189
206
|
On a terminal the verdict carries its own colour, `remove` green, `keep` blue
|
|
190
207
|
and `unknown` yellow, with the branch in bold and the path dimmed. That
|
|
@@ -208,7 +225,13 @@ squashes, so the intermediate state it holds differs from the final one in
|
|
|
208
225
|
the same regions, and a diff cannot separate a stale branch from one with
|
|
209
226
|
work left. A merged pull request settles it, cross-checked against the
|
|
210
227
|
commits an upstream has not got, because a request speaks for what reached
|
|
211
|
-
it and nothing about what never did. `--no-forge` decides from git alone
|
|
228
|
+
it and nothing about what never did. `--no-forge` decides from git alone, and
|
|
229
|
+
so does a run whose fetch just failed.
|
|
230
|
+
|
|
231
|
+
The question goes to the repository the command is standing in and nowhere
|
|
232
|
+
else. `GH_REPO` and `GITLAB_REPO` beat that directory, so both are dropped
|
|
233
|
+
before `gh` or `glab` runs; everything else in the environment, the token
|
|
234
|
+
included, is passed through.
|
|
212
235
|
|
|
213
236
|
A record left behind by a directory somebody deleted by hand is nobody's
|
|
214
237
|
verdict. `gws` names how many there are; clearing them is `git worktree prune`,
|
|
@@ -452,7 +475,10 @@ print one thing each and have nothing to be quiet about, takes `--json`, `-q`,
|
|
|
452
475
|
|
|
453
476
|
A remote that cannot be reached is not fatal anywhere. The fetch fails, the
|
|
454
477
|
command says so on stderr, and it answers from the refs already here, which is
|
|
455
|
-
where `--no-fetch` sends it on request.
|
|
478
|
+
where `--no-fetch` sends it on request. The forge is not asked either: it is
|
|
479
|
+
over the same network, and `gh` waits 30 seconds before saying so, once per
|
|
480
|
+
branch. `--no-fetch` alone says nothing about the network, so it leaves the
|
|
481
|
+
forge asked.
|
|
456
482
|
|
|
457
483
|
Data goes to stdout and diagnostics to stderr, the prompt included, so `--json`
|
|
458
484
|
is parseable in every mode. Colour is decided per stream and only for a
|
|
@@ -507,7 +533,9 @@ is refused with them: it deletes refs without `-d` appearing at all.
|
|
|
507
533
|
The Python, the tests and the release procedure are in
|
|
508
534
|
[docs/DEVELOPMENT.md](docs/DEVELOPMENT.md). The rules the code follows are in
|
|
509
535
|
[AGENTS.md](AGENTS.md). What changed in each release is in
|
|
510
|
-
[CHANGELOG.md](CHANGELOG.md).
|
|
536
|
+
[CHANGELOG.md](CHANGELOG.md). What was decided and what must not break,
|
|
537
|
+
including the alternatives that were closed, is in
|
|
538
|
+
[docs/REFERENCE.md](docs/REFERENCE.md).
|
|
511
539
|
|
|
512
540
|
## Licence
|
|
513
541
|
|
|
@@ -38,6 +38,10 @@ function, because a binary cannot change its caller's directory.
|
|
|
38
38
|
|
|
39
39
|
`worktrees` is the same program under its long name.
|
|
40
40
|
|
|
41
|
+
Ctrl-C interrupts a running command with exit code 130 and no traceback.
|
|
42
|
+
At a selection or removal prompt, it cancels without choosing or removing
|
|
43
|
+
a worktree.
|
|
44
|
+
|
|
41
45
|
`gws` and `gwp` are what this tool is for and their behaviour is settled.
|
|
42
46
|
|
|
43
47
|
**`gwnb` and `gwrot` are alpha and may go.** They start branches rather than
|
|
@@ -134,6 +138,12 @@ subcommand and shorthand, `gwl --complete` prints every worktree, and both
|
|
|
134
138
|
shells narrow what those return, so the matching stays in one place and a
|
|
135
139
|
command added to the table needs no edit in either shell.
|
|
136
140
|
|
|
141
|
+
One row a line, `label<TAB>path`. A worktree whose path holds a newline is
|
|
142
|
+
left out of that listing, because both shells would read it as two rows and
|
|
143
|
+
offer the tail as a worktree of its own. `gwa` cannot make such a path, since
|
|
144
|
+
it derives from a branch name and git refuses a newline in a ref, and the
|
|
145
|
+
worktree is still reachable by name or path.
|
|
146
|
+
|
|
137
147
|
Neither manager puts a binary on `$PATH`, which is why the two installs stay
|
|
138
148
|
separate.
|
|
139
149
|
|
|
@@ -149,6 +159,7 @@ unknown never-pushed not merged into origin/main, and no upstream says whethe
|
|
|
149
159
|
remove squash-merged squash-merged /home/you/git/.worktrees/squash-merged/repo
|
|
150
160
|
|
|
151
161
|
1 removable, 3 kept, 1 unclear
|
|
162
|
+
2 worktree(s) under /home/you/git/.worktrees belong to another repository
|
|
152
163
|
unclear, and gwp does not touch these: never-pushed
|
|
153
164
|
gwp removes the 1 marked removable
|
|
154
165
|
```
|
|
@@ -158,7 +169,13 @@ so the table shows what `git worktree list` shows; nothing proposes it, and
|
|
|
158
169
|
`git worktree remove` answers `fatal: '<path>' is a main working tree`
|
|
159
170
|
whatever flag it is given. Paths are absolute wherever this
|
|
160
171
|
prints one, so a row can be pasted into the next command. The table and the
|
|
161
|
-
count are on stdout;
|
|
172
|
+
count are on stdout; everything after them is on stderr.
|
|
173
|
+
|
|
174
|
+
Every repository in the same parent directory keeps its worktrees under that
|
|
175
|
+
one `.worktrees` root, so some of the directories in there are a sibling's.
|
|
176
|
+
`gws` counts those and says so, because nothing else does, and `--json`
|
|
177
|
+
carries the same count as `neighbours`. No command here reads or removes
|
|
178
|
+
them, and the count comes from walking the root rather than from asking git.
|
|
162
179
|
|
|
163
180
|
On a terminal the verdict carries its own colour, `remove` green, `keep` blue
|
|
164
181
|
and `unknown` yellow, with the branch in bold and the path dimmed. That
|
|
@@ -182,7 +199,13 @@ squashes, so the intermediate state it holds differs from the final one in
|
|
|
182
199
|
the same regions, and a diff cannot separate a stale branch from one with
|
|
183
200
|
work left. A merged pull request settles it, cross-checked against the
|
|
184
201
|
commits an upstream has not got, because a request speaks for what reached
|
|
185
|
-
it and nothing about what never did. `--no-forge` decides from git alone
|
|
202
|
+
it and nothing about what never did. `--no-forge` decides from git alone, and
|
|
203
|
+
so does a run whose fetch just failed.
|
|
204
|
+
|
|
205
|
+
The question goes to the repository the command is standing in and nowhere
|
|
206
|
+
else. `GH_REPO` and `GITLAB_REPO` beat that directory, so both are dropped
|
|
207
|
+
before `gh` or `glab` runs; everything else in the environment, the token
|
|
208
|
+
included, is passed through.
|
|
186
209
|
|
|
187
210
|
A record left behind by a directory somebody deleted by hand is nobody's
|
|
188
211
|
verdict. `gws` names how many there are; clearing them is `git worktree prune`,
|
|
@@ -426,7 +449,10 @@ print one thing each and have nothing to be quiet about, takes `--json`, `-q`,
|
|
|
426
449
|
|
|
427
450
|
A remote that cannot be reached is not fatal anywhere. The fetch fails, the
|
|
428
451
|
command says so on stderr, and it answers from the refs already here, which is
|
|
429
|
-
where `--no-fetch` sends it on request.
|
|
452
|
+
where `--no-fetch` sends it on request. The forge is not asked either: it is
|
|
453
|
+
over the same network, and `gh` waits 30 seconds before saying so, once per
|
|
454
|
+
branch. `--no-fetch` alone says nothing about the network, so it leaves the
|
|
455
|
+
forge asked.
|
|
430
456
|
|
|
431
457
|
Data goes to stdout and diagnostics to stderr, the prompt included, so `--json`
|
|
432
458
|
is parseable in every mode. Colour is decided per stream and only for a
|
|
@@ -481,7 +507,9 @@ is refused with them: it deletes refs without `-d` appearing at all.
|
|
|
481
507
|
The Python, the tests and the release procedure are in
|
|
482
508
|
[docs/DEVELOPMENT.md](docs/DEVELOPMENT.md). The rules the code follows are in
|
|
483
509
|
[AGENTS.md](AGENTS.md). What changed in each release is in
|
|
484
|
-
[CHANGELOG.md](CHANGELOG.md).
|
|
510
|
+
[CHANGELOG.md](CHANGELOG.md). What was decided and what must not break,
|
|
511
|
+
including the alternatives that were closed, is in
|
|
512
|
+
[docs/REFERENCE.md](docs/REFERENCE.md).
|
|
485
513
|
|
|
486
514
|
## Licence
|
|
487
515
|
|
|
@@ -24,7 +24,9 @@ invisible to it, so CI is the first thing to format a file you just wrote.
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
The rules this code follows, and the reasoning behind them, are in
|
|
27
|
-
[AGENTS.md](../AGENTS.md).
|
|
27
|
+
[AGENTS.md](../AGENTS.md). What was decided, what must not break and which
|
|
28
|
+
failure classes have a test are in [REFERENCE.md](REFERENCE.md). This file is
|
|
29
|
+
what to run.
|
|
28
30
|
|
|
29
31
|
## Layout
|
|
30
32
|
|