worktree-aid 1.2__tar.gz → 1.3__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.
- {worktree_aid-1.2/worktree_aid.egg-info → worktree_aid-1.3}/PKG-INFO +18 -18
- {worktree_aid-1.2 → worktree_aid-1.3}/README.md +17 -17
- {worktree_aid-1.2 → worktree_aid-1.3/worktree_aid.egg-info}/PKG-INFO +18 -18
- worktree_aid-1.3/worktree_aid.egg-info/scm_version.json +8 -0
- {worktree_aid-1.2 → worktree_aid-1.3}/worktree_aid.py +20 -14
- worktree_aid-1.2/worktree_aid.egg-info/scm_version.json +0 -8
- {worktree_aid-1.2 → worktree_aid-1.3}/.gitignore +0 -0
- {worktree_aid-1.2 → worktree_aid-1.3}/justfile +0 -0
- {worktree_aid-1.2 → worktree_aid-1.3}/pyproject.toml +0 -0
- {worktree_aid-1.2 → worktree_aid-1.3}/setup.cfg +0 -0
- {worktree_aid-1.2 → worktree_aid-1.3}/worktree_aid.egg-info/SOURCES.txt +0 -0
- {worktree_aid-1.2 → worktree_aid-1.3}/worktree_aid.egg-info/dependency_links.txt +0 -0
- {worktree_aid-1.2 → worktree_aid-1.3}/worktree_aid.egg-info/entry_points.txt +0 -0
- {worktree_aid-1.2 → worktree_aid-1.3}/worktree_aid.egg-info/requires.txt +0 -0
- {worktree_aid-1.2 → worktree_aid-1.3}/worktree_aid.egg-info/scm_file_list.json +0 -0
- {worktree_aid-1.2 → worktree_aid-1.3}/worktree_aid.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: worktree-aid
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3
|
|
4
4
|
Summary: Linux command line tool to aid creating, switching, and removing git worktrees
|
|
5
5
|
Author-email: Mark Blakeney <mark.blakeney@bullet-systems.net>
|
|
6
6
|
License-Expression: GPL-3.0-or-later
|
|
@@ -100,7 +100,7 @@ aliases: a
|
|
|
100
100
|
### Command `rm`
|
|
101
101
|
|
|
102
102
|
```
|
|
103
|
-
usage: wt rm [-h] [-k] [-f] [worktree]
|
|
103
|
+
usage: wt rm [-h] [-k] [-f] [worktree ...]
|
|
104
104
|
|
|
105
105
|
Remove worktree + branch.
|
|
106
106
|
|
|
@@ -187,8 +187,9 @@ $ yay -S worktree-aid # or your preferred AUR helper
|
|
|
187
187
|
```
|
|
188
188
|
|
|
189
189
|
You also need to install a fuzzy finder program such as [`fzf`][fzf] which is
|
|
190
|
-
the default used by `worktree-aid`. See [fuzzy finder
|
|
191
|
-
|
|
190
|
+
the default used by `worktree-aid`. See [fuzzy finder
|
|
191
|
+
installation](#fuzzy-finder-integration) instructions for possible
|
|
192
|
+
alternatives.
|
|
192
193
|
|
|
193
194
|
## Setup
|
|
194
195
|
|
|
@@ -233,11 +234,7 @@ The above sets `-R` (for relative display of worktree directories) as default fo
|
|
|
233
234
|
`wt` command.
|
|
234
235
|
|
|
235
236
|
The following options are sensible candidates to set as default options:
|
|
236
|
-
|
|
237
|
-
- `-B/--basedir`,
|
|
238
|
-
- `-R/--relative`,
|
|
239
|
-
- `-U/--no-user`,
|
|
240
|
-
- `-F/--fuzzy`.
|
|
237
|
+
`-B/--basedir`, `-R/--relative`, `-U/--no-user`, `-F/--fuzzy`.
|
|
241
238
|
|
|
242
239
|
## Worktree Base Directory
|
|
243
240
|
|
|
@@ -246,9 +243,12 @@ worktrees. It is set to a default as below but you can change this to any
|
|
|
246
243
|
directory you like. It can be absolute or relative where relative paths are
|
|
247
244
|
relative to base repository directory.
|
|
248
245
|
|
|
249
|
-
- Default is `-B ../worktrees/{repo}` which is the same as the [Zed] editor
|
|
250
|
-
|
|
251
|
-
- E.g. can use `-B
|
|
246
|
+
- Default is `-B ../worktrees/{repo}` which is the same as the [Zed] editor
|
|
247
|
+
uses by default.
|
|
248
|
+
- E.g. can use `-B ../{repo}.worktrees` which is same as [VS Code] uses by
|
|
249
|
+
default.
|
|
250
|
+
- E.g. can use `-B ~/worktrees/{repo}` to put all worktrees in a subdirectory
|
|
251
|
+
of your home directory.
|
|
252
252
|
|
|
253
253
|
The following place-markers can be used in the definition of the base directory:
|
|
254
254
|
|
|
@@ -256,8 +256,8 @@ The following place-markers can be used in the definition of the base directory:
|
|
|
256
256
|
- `{user}`: Substituted with the name of the user.
|
|
257
257
|
- `{home}`: Substituted with the home directory of the user (also can use `~` at start of a path).
|
|
258
258
|
|
|
259
|
-
Most likely if you want to set a custom
|
|
260
|
-
[default option](#default-options).
|
|
259
|
+
Most likely if you want to set a custom base directory then you will set `-B`
|
|
260
|
+
as a [default option](#default-options).
|
|
261
261
|
|
|
262
262
|
## Display as Relative Worktree Directories
|
|
263
263
|
|
|
@@ -268,10 +268,10 @@ can enable it in `worktree-aid` by adding the `-R/--relative` option, e.g:
|
|
|
268
268
|
|
|
269
269
|
```sh
|
|
270
270
|
$ wt l
|
|
271
|
-
../development 9796714 [development]
|
|
272
|
-
../milestone1 bc921b8 [milestone1]
|
|
273
|
-
../test e6d965a [test]
|
|
274
|
-
|
|
271
|
+
../worktrees/worktree-aid/development 9796714 [development]
|
|
272
|
+
../worktrees/worktree-aid/milestone1 bc921b8 [milestone1]
|
|
273
|
+
../worktrees/worktree-aid/test e6d965a [test]
|
|
274
|
+
f76b8e0 [main]
|
|
275
275
|
```
|
|
276
276
|
|
|
277
277
|
Most likely you will want to set `-R` as a [default option](#default-options).
|
|
@@ -88,7 +88,7 @@ aliases: a
|
|
|
88
88
|
### Command `rm`
|
|
89
89
|
|
|
90
90
|
```
|
|
91
|
-
usage: wt rm [-h] [-k] [-f] [worktree]
|
|
91
|
+
usage: wt rm [-h] [-k] [-f] [worktree ...]
|
|
92
92
|
|
|
93
93
|
Remove worktree + branch.
|
|
94
94
|
|
|
@@ -175,8 +175,9 @@ $ yay -S worktree-aid # or your preferred AUR helper
|
|
|
175
175
|
```
|
|
176
176
|
|
|
177
177
|
You also need to install a fuzzy finder program such as [`fzf`][fzf] which is
|
|
178
|
-
the default used by `worktree-aid`. See [fuzzy finder
|
|
179
|
-
|
|
178
|
+
the default used by `worktree-aid`. See [fuzzy finder
|
|
179
|
+
installation](#fuzzy-finder-integration) instructions for possible
|
|
180
|
+
alternatives.
|
|
180
181
|
|
|
181
182
|
## Setup
|
|
182
183
|
|
|
@@ -221,11 +222,7 @@ The above sets `-R` (for relative display of worktree directories) as default fo
|
|
|
221
222
|
`wt` command.
|
|
222
223
|
|
|
223
224
|
The following options are sensible candidates to set as default options:
|
|
224
|
-
|
|
225
|
-
- `-B/--basedir`,
|
|
226
|
-
- `-R/--relative`,
|
|
227
|
-
- `-U/--no-user`,
|
|
228
|
-
- `-F/--fuzzy`.
|
|
225
|
+
`-B/--basedir`, `-R/--relative`, `-U/--no-user`, `-F/--fuzzy`.
|
|
229
226
|
|
|
230
227
|
## Worktree Base Directory
|
|
231
228
|
|
|
@@ -234,9 +231,12 @@ worktrees. It is set to a default as below but you can change this to any
|
|
|
234
231
|
directory you like. It can be absolute or relative where relative paths are
|
|
235
232
|
relative to base repository directory.
|
|
236
233
|
|
|
237
|
-
- Default is `-B ../worktrees/{repo}` which is the same as the [Zed] editor
|
|
238
|
-
|
|
239
|
-
- E.g. can use `-B
|
|
234
|
+
- Default is `-B ../worktrees/{repo}` which is the same as the [Zed] editor
|
|
235
|
+
uses by default.
|
|
236
|
+
- E.g. can use `-B ../{repo}.worktrees` which is same as [VS Code] uses by
|
|
237
|
+
default.
|
|
238
|
+
- E.g. can use `-B ~/worktrees/{repo}` to put all worktrees in a subdirectory
|
|
239
|
+
of your home directory.
|
|
240
240
|
|
|
241
241
|
The following place-markers can be used in the definition of the base directory:
|
|
242
242
|
|
|
@@ -244,8 +244,8 @@ The following place-markers can be used in the definition of the base directory:
|
|
|
244
244
|
- `{user}`: Substituted with the name of the user.
|
|
245
245
|
- `{home}`: Substituted with the home directory of the user (also can use `~` at start of a path).
|
|
246
246
|
|
|
247
|
-
Most likely if you want to set a custom
|
|
248
|
-
[default option](#default-options).
|
|
247
|
+
Most likely if you want to set a custom base directory then you will set `-B`
|
|
248
|
+
as a [default option](#default-options).
|
|
249
249
|
|
|
250
250
|
## Display as Relative Worktree Directories
|
|
251
251
|
|
|
@@ -256,10 +256,10 @@ can enable it in `worktree-aid` by adding the `-R/--relative` option, e.g:
|
|
|
256
256
|
|
|
257
257
|
```sh
|
|
258
258
|
$ wt l
|
|
259
|
-
../development 9796714 [development]
|
|
260
|
-
../milestone1 bc921b8 [milestone1]
|
|
261
|
-
../test e6d965a [test]
|
|
262
|
-
|
|
259
|
+
../worktrees/worktree-aid/development 9796714 [development]
|
|
260
|
+
../worktrees/worktree-aid/milestone1 bc921b8 [milestone1]
|
|
261
|
+
../worktrees/worktree-aid/test e6d965a [test]
|
|
262
|
+
f76b8e0 [main]
|
|
263
263
|
```
|
|
264
264
|
|
|
265
265
|
Most likely you will want to set `-R` as a [default option](#default-options).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: worktree-aid
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3
|
|
4
4
|
Summary: Linux command line tool to aid creating, switching, and removing git worktrees
|
|
5
5
|
Author-email: Mark Blakeney <mark.blakeney@bullet-systems.net>
|
|
6
6
|
License-Expression: GPL-3.0-or-later
|
|
@@ -100,7 +100,7 @@ aliases: a
|
|
|
100
100
|
### Command `rm`
|
|
101
101
|
|
|
102
102
|
```
|
|
103
|
-
usage: wt rm [-h] [-k] [-f] [worktree]
|
|
103
|
+
usage: wt rm [-h] [-k] [-f] [worktree ...]
|
|
104
104
|
|
|
105
105
|
Remove worktree + branch.
|
|
106
106
|
|
|
@@ -187,8 +187,9 @@ $ yay -S worktree-aid # or your preferred AUR helper
|
|
|
187
187
|
```
|
|
188
188
|
|
|
189
189
|
You also need to install a fuzzy finder program such as [`fzf`][fzf] which is
|
|
190
|
-
the default used by `worktree-aid`. See [fuzzy finder
|
|
191
|
-
|
|
190
|
+
the default used by `worktree-aid`. See [fuzzy finder
|
|
191
|
+
installation](#fuzzy-finder-integration) instructions for possible
|
|
192
|
+
alternatives.
|
|
192
193
|
|
|
193
194
|
## Setup
|
|
194
195
|
|
|
@@ -233,11 +234,7 @@ The above sets `-R` (for relative display of worktree directories) as default fo
|
|
|
233
234
|
`wt` command.
|
|
234
235
|
|
|
235
236
|
The following options are sensible candidates to set as default options:
|
|
236
|
-
|
|
237
|
-
- `-B/--basedir`,
|
|
238
|
-
- `-R/--relative`,
|
|
239
|
-
- `-U/--no-user`,
|
|
240
|
-
- `-F/--fuzzy`.
|
|
237
|
+
`-B/--basedir`, `-R/--relative`, `-U/--no-user`, `-F/--fuzzy`.
|
|
241
238
|
|
|
242
239
|
## Worktree Base Directory
|
|
243
240
|
|
|
@@ -246,9 +243,12 @@ worktrees. It is set to a default as below but you can change this to any
|
|
|
246
243
|
directory you like. It can be absolute or relative where relative paths are
|
|
247
244
|
relative to base repository directory.
|
|
248
245
|
|
|
249
|
-
- Default is `-B ../worktrees/{repo}` which is the same as the [Zed] editor
|
|
250
|
-
|
|
251
|
-
- E.g. can use `-B
|
|
246
|
+
- Default is `-B ../worktrees/{repo}` which is the same as the [Zed] editor
|
|
247
|
+
uses by default.
|
|
248
|
+
- E.g. can use `-B ../{repo}.worktrees` which is same as [VS Code] uses by
|
|
249
|
+
default.
|
|
250
|
+
- E.g. can use `-B ~/worktrees/{repo}` to put all worktrees in a subdirectory
|
|
251
|
+
of your home directory.
|
|
252
252
|
|
|
253
253
|
The following place-markers can be used in the definition of the base directory:
|
|
254
254
|
|
|
@@ -256,8 +256,8 @@ The following place-markers can be used in the definition of the base directory:
|
|
|
256
256
|
- `{user}`: Substituted with the name of the user.
|
|
257
257
|
- `{home}`: Substituted with the home directory of the user (also can use `~` at start of a path).
|
|
258
258
|
|
|
259
|
-
Most likely if you want to set a custom
|
|
260
|
-
[default option](#default-options).
|
|
259
|
+
Most likely if you want to set a custom base directory then you will set `-B`
|
|
260
|
+
as a [default option](#default-options).
|
|
261
261
|
|
|
262
262
|
## Display as Relative Worktree Directories
|
|
263
263
|
|
|
@@ -268,10 +268,10 @@ can enable it in `worktree-aid` by adding the `-R/--relative` option, e.g:
|
|
|
268
268
|
|
|
269
269
|
```sh
|
|
270
270
|
$ wt l
|
|
271
|
-
../development 9796714 [development]
|
|
272
|
-
../milestone1 bc921b8 [milestone1]
|
|
273
|
-
../test e6d965a [test]
|
|
274
|
-
|
|
271
|
+
../worktrees/worktree-aid/development 9796714 [development]
|
|
272
|
+
../worktrees/worktree-aid/milestone1 bc921b8 [milestone1]
|
|
273
|
+
../worktrees/worktree-aid/test e6d965a [test]
|
|
274
|
+
f76b8e0 [main]
|
|
275
275
|
```
|
|
276
276
|
|
|
277
277
|
Most likely you will want to set `-R` as a [default option](#default-options).
|
|
@@ -273,12 +273,15 @@ class Trees:
|
|
|
273
273
|
@classmethod
|
|
274
274
|
def remove_worktree(cls, name: str, args: Namespace) -> Path | None:
|
|
275
275
|
"Remove the worktree and branch with the given name"
|
|
276
|
-
if name:
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
276
|
+
if not (tree := cls.get_tree(name)):
|
|
277
|
+
sys.exit(f'error: no worktree found with name "{name}".')
|
|
278
|
+
|
|
279
|
+
if tree == cls.toplevel:
|
|
280
|
+
print(
|
|
281
|
+
f'warning: not removing top-level worktree "{tree.path}"',
|
|
282
|
+
file=sys.stderr,
|
|
283
|
+
)
|
|
284
|
+
return None
|
|
282
285
|
|
|
283
286
|
# Change to the top-level worktree directory before deleting a worktree
|
|
284
287
|
# and/or branch, in case the current directory is removed.
|
|
@@ -472,8 +475,7 @@ class rm_:
|
|
|
472
475
|
)
|
|
473
476
|
parser.add_argument(
|
|
474
477
|
'worktree',
|
|
475
|
-
|
|
476
|
-
nargs='?',
|
|
478
|
+
nargs='*',
|
|
477
479
|
help='worktree + branch name to remove. If not specified then '
|
|
478
480
|
'fuzzy finder will prompt with a list of worktrees, with the '
|
|
479
481
|
'current worktree as the default selection.',
|
|
@@ -482,13 +484,17 @@ class rm_:
|
|
|
482
484
|
@staticmethod
|
|
483
485
|
def run(args: Namespace) -> str | None:
|
|
484
486
|
Trees.fetch(args)
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
487
|
+
retpath = None
|
|
488
|
+
for name in args.worktree or ['']:
|
|
489
|
+
if not name:
|
|
490
|
+
if not (path := Trees.prompt(args)):
|
|
491
|
+
return None
|
|
492
|
+
name = path.name
|
|
489
493
|
|
|
490
|
-
|
|
491
|
-
|
|
494
|
+
if path := Trees.remove_worktree(name, args):
|
|
495
|
+
retpath = path
|
|
496
|
+
|
|
497
|
+
return str(retpath) if retpath else None
|
|
492
498
|
|
|
493
499
|
|
|
494
500
|
# COMMAND
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|