git-worktrees 0.6.1__tar.gz → 0.6.2__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 (102) hide show
  1. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/AGENTS.md +7 -4
  2. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/CHANGELOG.md +10 -0
  3. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/PKG-INFO +8 -7
  4. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/README.md +7 -6
  5. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/conf.d/worktrees.fish +1 -1
  6. git_worktrees-0.6.2/functions/gwp!.fish +4 -0
  7. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/pyproject.toml +1 -1
  8. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/test_shims.py +39 -7
  9. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/uv.lock +1 -1
  10. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/completions/_gwp +1 -1
  11. git_worktrees-0.6.2/zsh/plugins/worktrees/functions/gwp! +2 -0
  12. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/worktrees.plugin.zsh +5 -4
  13. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/.claude/settings.json +0 -0
  14. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/.github/workflows/codeql.yml +0 -0
  15. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/.github/workflows/publish.yml +0 -0
  16. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/.github/workflows/testpypi.yml +0 -0
  17. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/.github/workflows/tests.yml +0 -0
  18. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/.gitignore +0 -0
  19. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/.pre-commit-config.yaml +0 -0
  20. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/.python-version +0 -0
  21. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/.releasetools.yaml +0 -0
  22. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/LICENSE +0 -0
  23. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/Makefile +0 -0
  24. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/completions/gw.fish +0 -0
  25. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/completions/gwa.fish +0 -0
  26. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/completions/gwbc.fish +0 -0
  27. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/completions/gwbd.fish +0 -0
  28. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/completions/gwbs.fish +0 -0
  29. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/completions/gwh.fish +0 -0
  30. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/completions/gwl.fish +0 -0
  31. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/completions/gwm.fish +0 -0
  32. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/completions/gwp.fish +0 -0
  33. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/completions/gwr.fish +0 -0
  34. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/completions/gwrot.fish +0 -0
  35. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/completions/gws.fish +0 -0
  36. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/completions/worktrees.fish +0 -0
  37. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/docs/BENCHMARK.md +0 -0
  38. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/docs/DEVELOPMENT.md +0 -0
  39. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/docs/REFERENCE.md +0 -0
  40. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/docs/commands/branch-delete.md +0 -0
  41. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/docs/commands/branch-status.md +0 -0
  42. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/functions/gwa.fish +0 -0
  43. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/functions/gwl.fish +0 -0
  44. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/functions/gwm.fish +0 -0
  45. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/functions/gwr!.fish +0 -0
  46. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/functions/gwr.fish +0 -0
  47. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/hatch_build.py +0 -0
  48. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/renovate.json +0 -0
  49. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/scripts/README.md +0 -0
  50. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/scripts/benchmark.py +0 -0
  51. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/scripts/bump_version.py +0 -0
  52. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/scripts/verify-publish.bash +0 -0
  53. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/__init__.py +0 -0
  54. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/branch_cli.py +0 -0
  55. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/branch_forge.py +0 -0
  56. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/branches.py +0 -0
  57. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/cli.py +0 -0
  58. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/errors.py +0 -0
  59. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/forge.py +0 -0
  60. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/git.py +0 -0
  61. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/layout.py +0 -0
  62. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/merged.py +0 -0
  63. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/new_branch.py +0 -0
  64. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/pick.py +0 -0
  65. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/progress.py +0 -0
  66. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/prune.py +0 -0
  67. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/render.py +0 -0
  68. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/repo.py +0 -0
  69. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/rotate.py +0 -0
  70. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/verdicts.py +0 -0
  71. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/src/worktrees/worktree.py +0 -0
  72. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/conftest.py +0 -0
  73. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/test_benchmark.py +0 -0
  74. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/test_branch_forge.py +0 -0
  75. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/test_branches.py +0 -0
  76. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/test_cli.py +0 -0
  77. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/test_completions.py +0 -0
  78. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/test_fixture.py +0 -0
  79. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/test_forge.py +0 -0
  80. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/test_gates.py +0 -0
  81. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/test_new_branch.py +0 -0
  82. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/test_render.py +0 -0
  83. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/test_rotate.py +0 -0
  84. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/test_spec.py +0 -0
  85. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/test_version.py +0 -0
  86. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/tests/test_worktree.py +0 -0
  87. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/completions/_gw +0 -0
  88. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/completions/_gwa +0 -0
  89. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/completions/_gwbc +0 -0
  90. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/completions/_gwbd +0 -0
  91. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/completions/_gwbs +0 -0
  92. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/completions/_gwh +0 -0
  93. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/completions/_gwl +0 -0
  94. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/completions/_gwm +0 -0
  95. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/completions/_gwr +0 -0
  96. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/completions/_gwrot +0 -0
  97. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/completions/_gws +0 -0
  98. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/functions/gwa +0 -0
  99. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/functions/gwl +0 -0
  100. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/functions/gwm +0 -0
  101. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/functions/gwr +0 -0
  102. {git_worktrees-0.6.1 → git_worktrees-0.6.2}/zsh/plugins/worktrees/functions/gwr! +0 -0
@@ -69,10 +69,13 @@ end
69
69
 
70
70
  `command` is what stops the function calling itself, in all three shells.
71
71
 
72
- One other kind of function exists: a shortcut, a banged name that calls a shim
73
- with its flags fixed and does nothing else. `gwr!` is `gwr --delete-ignored`.
74
- It calls the `gwr` function rather than `command gwr`, so the caller still
75
- lands where the binary says, and it has no console script of its own.
72
+ One other kind of function exists: a shortcut, a banged name that calls a
73
+ command with its flags fixed and does nothing else. `gwr!` is `gwr
74
+ --delete-ignored`, and `gwp!` is `gwp --force-refresh --delete-ignored
75
+ --yes`. A shortcut calls its command by its plain name, so `gwr!` reaches the
76
+ `gwr` function rather than `command gwr` and the caller still lands where the
77
+ binary says. No binary carries a banged name, so a shortcut shadows nothing,
78
+ and none has a console script of its own.
76
79
  `SHORTCUTS` in `tests/test_shims.py` lists them and holds each to one line.
77
80
 
78
81
  ## Two commands start branches
@@ -17,6 +17,16 @@ 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.6.2 - 2026-11-04
21
+
22
+ ### Added
23
+
24
+ `gwp!` runs `gwp --force-refresh --delete-ignored --yes` in fish and zsh:
25
+ it fetches fresh, counts worktrees holding gitignored files as removable,
26
+ and removes everything `gws` marks removable without asking. Arguments
27
+ after it pass through, so `gwp! --branch NAME` works. Update the fish or
28
+ zsh plugin to install this shortcut.
29
+
20
30
  ## 0.6.1 - 2026-11-02
21
31
 
22
32
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: git-worktrees
3
- Version: 0.6.1
3
+ Version: 0.6.2
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
@@ -46,6 +46,7 @@ a shell function of the same name.
46
46
  | `gwm NEW` | rename this worktree's branch and move the checkout to match |
47
47
  | `gwr [QUERY]` | remove a worktree whose branch is finished, and the branch |
48
48
  | `gwr! [QUERY]` | `gwr --delete-ignored`, a shell function in fish and zsh |
49
+ | `gwp!` | `gwp --force-refresh --delete-ignored --yes`, a shell function in fish and zsh |
49
50
  | `gwbc NAME` | fetch, then branch `NAME` off the head branch and check it out |
50
51
  | `gwrot` | start the next branch after this one, or catch the head branch up |
51
52
  | `gwh` | print that table, with every name each command answers to |
@@ -143,12 +144,12 @@ the plugin's tag to the same release, as each manager below describes.
143
144
  ### fish
144
145
 
145
146
  ```console
146
- fisher install MihaiBojin/worktrees@v0.6.1
147
+ fisher install MihaiBojin/worktrees@v0.6.2
147
148
  ```
148
149
 
149
150
  Fisher copies `functions/`, `completions/` and `conf.d/` from the repository
150
- root, so the functions for `gwa`, `gwl`, `gwm`, `gwr` and `gwr!` land together
151
- with a completion for every command. Nothing has to be sourced.
151
+ root, so the functions for `gwa`, `gwl`, `gwm`, `gwr`, `gwr!` and `gwp!` land
152
+ together with a completion for every command. Nothing has to be sourced.
152
153
 
153
154
  To change release, edit the tag on that line of
154
155
  `$__fish_config_dir/fish_plugins` and run `fisher update`. The same edit moves
@@ -160,7 +161,7 @@ the untagged one holds the files.
160
161
  Antidote takes a `path:` into the repository, and `branch:` takes a tag:
161
162
 
162
163
  ```
163
- MihaiBojin/worktrees branch:v0.6.1 path:zsh/plugins/worktrees # in zsh_plugins.txt
164
+ MihaiBojin/worktrees branch:v0.6.2 path:zsh/plugins/worktrees # in zsh_plugins.txt
164
165
  ```
165
166
 
166
167
  The plugin puts its own `functions/` and `completions/` on `fpath` and
@@ -532,7 +533,7 @@ their own and `gwbc` puts them on a branch.
532
533
 
533
534
  ```console
534
535
  $ gwh
535
- worktrees 0.6.1: git worktree commands that refuse to lose work
536
+ worktrees 0.6.2: git worktree commands that refuse to lose work
536
537
 
537
538
  COMMAND GW DOES
538
539
  gws gw status (s, st) which worktrees are finished, and why
@@ -551,7 +552,7 @@ gwbd [NAME ...] gw branch delete delete local branches proved finished
551
552
  gwa, gwl, gwm and gwr change the directory you are standing in.
552
553
  A binary cannot do that, so each needs the shell function of the same name
553
554
  from the plugin; the rest need nothing but $PATH.
554
- The shell plugin here is 0.6.1, the same release as these commands.
555
+ The shell plugin here is 0.6.2, the same release as these commands.
555
556
  ```
556
557
 
557
558
  `gw help`, `gw h` and `gw` with no subcommand print the same thing. One table
@@ -20,6 +20,7 @@ a shell function of the same name.
20
20
  | `gwm NEW` | rename this worktree's branch and move the checkout to match |
21
21
  | `gwr [QUERY]` | remove a worktree whose branch is finished, and the branch |
22
22
  | `gwr! [QUERY]` | `gwr --delete-ignored`, a shell function in fish and zsh |
23
+ | `gwp!` | `gwp --force-refresh --delete-ignored --yes`, a shell function in fish and zsh |
23
24
  | `gwbc NAME` | fetch, then branch `NAME` off the head branch and check it out |
24
25
  | `gwrot` | start the next branch after this one, or catch the head branch up |
25
26
  | `gwh` | print that table, with every name each command answers to |
@@ -117,12 +118,12 @@ the plugin's tag to the same release, as each manager below describes.
117
118
  ### fish
118
119
 
119
120
  ```console
120
- fisher install MihaiBojin/worktrees@v0.6.1
121
+ fisher install MihaiBojin/worktrees@v0.6.2
121
122
  ```
122
123
 
123
124
  Fisher copies `functions/`, `completions/` and `conf.d/` from the repository
124
- root, so the functions for `gwa`, `gwl`, `gwm`, `gwr` and `gwr!` land together
125
- with a completion for every command. Nothing has to be sourced.
125
+ root, so the functions for `gwa`, `gwl`, `gwm`, `gwr`, `gwr!` and `gwp!` land
126
+ together with a completion for every command. Nothing has to be sourced.
126
127
 
127
128
  To change release, edit the tag on that line of
128
129
  `$__fish_config_dir/fish_plugins` and run `fisher update`. The same edit moves
@@ -134,7 +135,7 @@ the untagged one holds the files.
134
135
  Antidote takes a `path:` into the repository, and `branch:` takes a tag:
135
136
 
136
137
  ```
137
- MihaiBojin/worktrees branch:v0.6.1 path:zsh/plugins/worktrees # in zsh_plugins.txt
138
+ MihaiBojin/worktrees branch:v0.6.2 path:zsh/plugins/worktrees # in zsh_plugins.txt
138
139
  ```
139
140
 
140
141
  The plugin puts its own `functions/` and `completions/` on `fpath` and
@@ -506,7 +507,7 @@ their own and `gwbc` puts them on a branch.
506
507
 
507
508
  ```console
508
509
  $ gwh
509
- worktrees 0.6.1: git worktree commands that refuse to lose work
510
+ worktrees 0.6.2: git worktree commands that refuse to lose work
510
511
 
511
512
  COMMAND GW DOES
512
513
  gws gw status (s, st) which worktrees are finished, and why
@@ -525,7 +526,7 @@ gwbd [NAME ...] gw branch delete delete local branches proved finished
525
526
  gwa, gwl, gwm and gwr change the directory you are standing in.
526
527
  A binary cannot do that, so each needs the shell function of the same name
527
528
  from the plugin; the rest need nothing but $PATH.
528
- The shell plugin here is 0.6.1, the same release as these commands.
529
+ The shell plugin here is 0.6.2, the same release as these commands.
529
530
  ```
530
531
 
531
532
  `gw help`, `gw h` and `gw` with no subcommand print the same thing. One table
@@ -4,4 +4,4 @@
4
4
  # The release this plugin came from, which `gwh` and `gw version` compare
5
5
  # with their own. Exported, because the environment is all a binary can see
6
6
  # of the shell that started it.
7
- set -gx WORKTREES_PLUGIN_VERSION 0.6.1
7
+ set -gx WORKTREES_PLUGIN_VERSION 0.6.2
@@ -0,0 +1,4 @@
1
+ # gwp! [--branch NAME]: gwp after a fresh fetch, deleting ignored files, without asking.
2
+ function gwp! --wraps 'gwp --force-refresh --delete-ignored --yes' --description 'gwp, fresh, deleting the gitignored files too, without asking'
3
+ gwp --force-refresh --delete-ignored --yes $argv
4
+ end
@@ -9,7 +9,7 @@ authors = [
9
9
  ]
10
10
  # Static, and the single source of truth for the version. Bump it in a pull
11
11
  # request and run `uv lock`; the release tag only has to agree with it.
12
- version = "0.6.1"
12
+ version = "0.6.2"
13
13
  # The standard library answers every question this asks. A dependency here
14
14
  # would be paid on every invocation, and an invocation is 67 ms of which 25 ms
15
15
  # is the interpreter starting.
@@ -21,8 +21,11 @@ import pytest
21
21
 
22
22
  ROOT = Path(__file__).resolve().parents[1]
23
23
  CD_COMMANDS = ("gwa", "gwl", "gwm", "gwr")
24
- # A shortcut calls a shim with its flags fixed, and nothing else.
25
- SHORTCUTS = {"gwr!": "gwr --delete-ignored"}
24
+ # A shortcut calls a command with its flags fixed, and nothing else.
25
+ SHORTCUTS = {
26
+ "gwr!": "gwr --delete-ignored",
27
+ "gwp!": "gwp --force-refresh --delete-ignored --yes",
28
+ }
26
29
 
27
30
 
28
31
  def scripts() -> dict[str, str]:
@@ -48,11 +51,13 @@ def test_the_two_dialects_ship_the_same_names() -> None:
48
51
 
49
52
 
50
53
  @pytest.mark.parametrize("name", SHORTCUTS)
51
- def test_a_shortcut_is_one_call_to_a_shim(name: str) -> None:
52
- """Through the shim, not `command`, so the caller still lands where the
53
- binary says. Anything more is logic, and logic belongs in the CLI."""
54
+ def test_a_shortcut_is_one_call_to_a_command(name: str) -> None:
55
+ """By its plain name, not `command`, so a shortcut to a shim still lands
56
+ where the binary says. Anything more is logic, and logic belongs in the
57
+ CLI."""
54
58
  call = SHORTCUTS[name]
55
- assert call.split()[0] in CD_COMMANDS
59
+ assert call.split()[0] in scripts()
60
+ assert name not in scripts()
56
61
  for path, line in (
57
62
  (ROOT / "functions" / f"{name}.fish", f"{call} $argv"),
58
63
  (ROOT / "zsh/plugins/worktrees/functions" / name, f'{call} "$@"'),
@@ -215,7 +220,12 @@ def _run_zsh(bin_dir: Path, line: str) -> tuple[int, str]:
215
220
  env = {**os.environ, "PATH": f"{bin_dir}:{os.environ['PATH']}"}
216
221
  fns = ROOT / "zsh/plugins/worktrees/functions"
217
222
  proc = subprocess.run(
218
- [zsh, "-f", "-c", f"fpath=({fns} $fpath); autoload -Uz gwa gwr 'gwr!'; {line}"],
223
+ [
224
+ zsh,
225
+ "-f",
226
+ "-c",
227
+ f"fpath=({fns} $fpath); autoload -Uz gwa gwr 'gwr!' 'gwp!'; {line}",
228
+ ],
219
229
  capture_output=True,
220
230
  text=True,
221
231
  env=env,
@@ -245,6 +255,28 @@ def test_the_zsh_shortcut_lands_where_gwr_says_with_the_flag(tmp_path) -> None:
245
255
  assert seen.read_text().split() == ["--delete-ignored", "x"]
246
256
 
247
257
 
258
+ @pytest.mark.parametrize("shell", ["fish", "zsh"])
259
+ def test_gwp_bang_runs_gwp_with_its_flags_and_its_exit_code(tmp_path, shell) -> None:
260
+ seen = tmp_path / "argv"
261
+ bin_dir = _fake(tmp_path, "gwp", f'#!/bin/sh\necho "$@" > "{seen}"\nexit 4\n')
262
+ if shell == "fish":
263
+ _, out = _run_fish(
264
+ bin_dir,
265
+ f"source '{ROOT / 'functions' / 'gwp!.fish'}'; "
266
+ "gwp! --branch x; echo code=$status",
267
+ )
268
+ else:
269
+ _, out = _run_zsh(bin_dir, "gwp! --branch x; echo code=$?")
270
+ assert "code=4" in out, out
271
+ assert seen.read_text().split() == [
272
+ "--force-refresh",
273
+ "--delete-ignored",
274
+ "--yes",
275
+ "--branch",
276
+ "x",
277
+ ]
278
+
279
+
248
280
  def test_the_zsh_shim_returns_the_binarys_exit_code(tmp_path) -> None:
249
281
  bin_dir = _fake(tmp_path, "gwa", "#!/bin/sh\nexit 3\n")
250
282
  code, _ = _run_zsh(bin_dir, "gwa")
@@ -40,7 +40,7 @@ wheels = [
40
40
 
41
41
  [[package]]
42
42
  name = "git-worktrees"
43
- version = "0.6.1"
43
+ version = "0.6.2"
44
44
  source = { editable = "." }
45
45
 
46
46
  [package.optional-dependencies]
@@ -1,4 +1,4 @@
1
- #compdef gwp
1
+ #compdef gwp gwp!
2
2
 
3
3
  # Flags as `gwp --help` lists them.
4
4
 
@@ -0,0 +1,2 @@
1
+ # gwp! [--branch NAME]: gwp after a fresh fetch, deleting ignored files, without asking.
2
+ gwp --force-refresh --delete-ignored --yes "$@"
@@ -1,5 +1,6 @@
1
- # The four commands that change the caller's directory, and gwr!, which is
2
- # gwr --delete-ignored.
1
+ # The four commands that change the caller's directory, and two shortcuts:
2
+ # gwr!, which is gwr --delete-ignored, and gwp!, which is gwp
3
+ # --force-refresh --delete-ignored --yes.
3
4
  #
4
5
  # Everything else here is a console script and needs nothing: gws, gwp, gwbc
5
6
  # and gwrot answer the same from a prompt and from a script. A binary cannot
@@ -12,9 +13,9 @@
12
13
  0="${${(M)0:#/*}:-$PWD/$0}"
13
14
 
14
15
  fpath+=("${0:h}/functions" "${0:h}/completions")
15
- autoload -Uz gwa gwl gwm gwr 'gwr!'
16
+ autoload -Uz gwa gwl gwm gwr 'gwr!' 'gwp!'
16
17
 
17
18
  # The release this plugin came from, which `gwh` and `gw version` compare
18
19
  # with their own. Exported, because the environment is all a binary can see
19
20
  # of the shell that started it.
20
- export WORKTREES_PLUGIN_VERSION=0.6.1
21
+ export WORKTREES_PLUGIN_VERSION=0.6.2
File without changes
File without changes
File without changes