skilleter-thingy 0.0.92__py3-none-any.whl → 0.0.94__py3-none-any.whl
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.
Potentially problematic release.
This version of skilleter-thingy might be problematic. Click here for more details.
- skilleter_thingy/git_update.py +8 -8
- skilleter_thingy/multigit.py +47 -22
- {skilleter_thingy-0.0.92.dist-info → skilleter_thingy-0.0.94.dist-info}/METADATA +1 -1
- {skilleter_thingy-0.0.92.dist-info → skilleter_thingy-0.0.94.dist-info}/RECORD +8 -8
- {skilleter_thingy-0.0.92.dist-info → skilleter_thingy-0.0.94.dist-info}/LICENSE +0 -0
- {skilleter_thingy-0.0.92.dist-info → skilleter_thingy-0.0.94.dist-info}/WHEEL +0 -0
- {skilleter_thingy-0.0.92.dist-info → skilleter_thingy-0.0.94.dist-info}/entry_points.txt +0 -0
- {skilleter_thingy-0.0.92.dist-info → skilleter_thingy-0.0.94.dist-info}/top_level.txt +0 -0
skilleter_thingy/git_update.py
CHANGED
|
@@ -93,6 +93,11 @@ def branch_rebase(args, results, branch):
|
|
|
93
93
|
|
|
94
94
|
logging.debug('No non-feature-branch parents found for %s. Feature branch parents could be: %s', branch, parents)
|
|
95
95
|
|
|
96
|
+
if not parents:
|
|
97
|
+
colour.write(f'[RED:WARNING]: Unable to rebase [BLUE:{branch}] branch as unable to determine its parent (no obvious candidates))', indent=4)
|
|
98
|
+
results['failed'].add(branch)
|
|
99
|
+
return
|
|
100
|
+
|
|
96
101
|
# Cheat - if we have multiple possible parents and one is 'develop', 'main' or 'master'
|
|
97
102
|
# choose it.
|
|
98
103
|
|
|
@@ -104,19 +109,14 @@ def branch_rebase(args, results, branch):
|
|
|
104
109
|
elif 'develop' in parents:
|
|
105
110
|
parent = 'develop'
|
|
106
111
|
else:
|
|
107
|
-
colour.write('[RED:WARNING]: Unable to rebase [BLUE
|
|
108
|
-
|
|
112
|
+
colour.write(f'[RED:WARNING]: Unable to rebase [BLUE:{branch}] branch as unable to determine its parent (could be any of {", ".join(parents)})',
|
|
113
|
+
indent=4)
|
|
109
114
|
results['failed'].add(branch)
|
|
110
115
|
return
|
|
111
116
|
|
|
112
117
|
elif len(parents) == 1:
|
|
113
118
|
parent = parents[0]
|
|
114
119
|
|
|
115
|
-
else:
|
|
116
|
-
colour.write(f'[RED:WARNING]: Unable to rebase [BLUE:{branch}] branch as unable to determine its parent (no obvious candidates))', indent=4)
|
|
117
|
-
results['failed'].add(branch)
|
|
118
|
-
return
|
|
119
|
-
|
|
120
120
|
if args.dry_run:
|
|
121
121
|
colour.write(f'[BOLD:Checking if] [BLUE:{branch}] [BOLD:needs to be rebased onto] [BLUE:{parent}]', indent=4)
|
|
122
122
|
|
|
@@ -296,7 +296,7 @@ def main():
|
|
|
296
296
|
|
|
297
297
|
branches = git.branches() if args.all or args.everything else [current_branch]
|
|
298
298
|
|
|
299
|
-
logging.info('Updating %s'
|
|
299
|
+
logging.info('Updating %s', ', '.join(branches))
|
|
300
300
|
|
|
301
301
|
# Filter out branches that the user wants to ignore
|
|
302
302
|
|
skilleter_thingy/multigit.py
CHANGED
|
@@ -15,22 +15,23 @@ import thingy.colour as colour
|
|
|
15
15
|
################################################################################
|
|
16
16
|
|
|
17
17
|
# DONE: / Output name of each git repo as it is processed as command sits there seeming to do nothing otherwise.
|
|
18
|
+
# DONE: Better error-handling - e.g. continue/abort option after failure in one repo
|
|
18
19
|
# DONE: Don't save the configuration on exit if it hasn't changed
|
|
19
20
|
# DONE: Don't use a fixed list of default branch names
|
|
21
|
+
# DONE: If the config file isn't in the current directory then search up the directory tree for it but run in the current directory
|
|
20
22
|
# DONE: Use the configuration file
|
|
21
23
|
# DONE: init function
|
|
22
|
-
#
|
|
24
|
+
# NOPE: Dry-run option - just pass the option to the Git command
|
|
25
|
+
# NOPE: Is it going to be a problem if the same repo is checked out twice or more in the same workspace - user problem
|
|
23
26
|
# NOPE: Pull/fetch - only output after running command and only if something updated
|
|
24
|
-
#
|
|
27
|
+
# NOPE: Switch to tomlkit
|
|
28
|
+
# TODO: -j option to run in parallel - yes, but it will only work with non-interactive Git commands
|
|
29
|
+
# TODO: Command that takes partial repo name and either returns full path or pops up window to autocomplete until single match found
|
|
25
30
|
# TODO: Consistent colours in output
|
|
26
|
-
# TODO: Dry-run option
|
|
27
|
-
# DONE: If the config file isn't in the current directory then search up the directory tree for it but run in the current directory
|
|
28
31
|
# TODO: If run in a subdirectory, only process repos in that tree (or have an option to do so)
|
|
29
|
-
# TODO: Is it going to be a problem if the same repo is checked out twice or more in the same workspace
|
|
30
|
-
# NOPE: Switch to tomlkit
|
|
31
32
|
# TODO: Verbose option
|
|
32
33
|
# TODO: When specifying list of repos, if repo name doesn't contain '/' prefix it with '*'?
|
|
33
|
-
|
|
34
|
+
# TODO: select_git_repos() and +dir should use consist way of selecting repos if possible
|
|
34
35
|
################################################################################
|
|
35
36
|
|
|
36
37
|
DEFAULT_CONFIG_FILE = 'multigit.toml'
|
|
@@ -224,6 +225,13 @@ def mg_init(args, config, console):
|
|
|
224
225
|
By default, it scans the tree for git directories and adds or updates them
|
|
225
226
|
in the configuration, using the current branch as the default branch. """
|
|
226
227
|
|
|
228
|
+
# Sanity checks
|
|
229
|
+
|
|
230
|
+
if args.modified or args.branched:
|
|
231
|
+
error('The "--modified" and "--branched" options cannot be used with the "init" subcommand')
|
|
232
|
+
elif not config:
|
|
233
|
+
error(f'Unable to location configuration file "{args.configuration_file}"')
|
|
234
|
+
|
|
227
235
|
# TODO: Update should remove or warn about repos that are no longer present
|
|
228
236
|
|
|
229
237
|
# Search for .git directories
|
|
@@ -241,9 +249,9 @@ def mg_init(args, config, console):
|
|
|
241
249
|
|
|
242
250
|
if 'origin' in remote:
|
|
243
251
|
config[repo]['origin'] = remote['origin']
|
|
244
|
-
config[repo]['name']= os.path.basename(remote['origin']).removesuffix('.git')
|
|
252
|
+
config[repo]['repo name']= os.path.basename(remote['origin']).removesuffix('.git')
|
|
245
253
|
else:
|
|
246
|
-
config[repo]['name'] = os.path.basename(repo)
|
|
254
|
+
config[repo]['repo name'] = os.path.basename(repo)
|
|
247
255
|
|
|
248
256
|
################################################################################
|
|
249
257
|
|
|
@@ -261,18 +269,39 @@ def mg_dir(args, config, console):
|
|
|
261
269
|
error('The +dir command takes no more than one parameter - the name of the working tree to search for')
|
|
262
270
|
elif args.parameters:
|
|
263
271
|
location = []
|
|
264
|
-
|
|
272
|
+
wild_prefix_location = []
|
|
273
|
+
wild_location = []
|
|
274
|
+
|
|
275
|
+
search_name = args.parameters[0]
|
|
276
|
+
|
|
277
|
+
# Search for exact matches, matches if prefixed by '*' or prefixed and suffixed with '*'
|
|
278
|
+
# unless it already contains '*'
|
|
265
279
|
|
|
266
280
|
for repo in select_git_repos(args, config):
|
|
267
|
-
if fnmatch.fnmatch(repo['name'],
|
|
281
|
+
if fnmatch.fnmatch(repo['repo name'], search_name):
|
|
268
282
|
location.append(repo.name)
|
|
269
283
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
284
|
+
elif '*' not in search_name:
|
|
285
|
+
if fnmatch.fnmatch(repo['repo name'], f'*{search_name}'):
|
|
286
|
+
wild_prefix_location.append(repo.name)
|
|
287
|
+
|
|
288
|
+
elif fnmatch.fnmatch(repo['repo name'], f'*{search_name}*'):
|
|
289
|
+
wild_location.append(repo.name)
|
|
290
|
+
|
|
291
|
+
for destinations in (location, wild_prefix_location, wild_location):
|
|
292
|
+
if len(destinations) == 1:
|
|
293
|
+
destination = destinations
|
|
294
|
+
break
|
|
295
|
+
elif len(destinations) > 1:
|
|
296
|
+
destination = destinations
|
|
274
297
|
|
|
275
|
-
|
|
298
|
+
if not destination:
|
|
299
|
+
error(f'No matches with [BLUE:{search_name}]')
|
|
300
|
+
|
|
301
|
+
if len(destination) > 1:
|
|
302
|
+
error(f'Multiple matches with [BLUE:{search_name}] - {" ".join(destination)}')
|
|
303
|
+
|
|
304
|
+
colour.write(os.path.join(os.path.dirname(args.configuration_file), destination[0]))
|
|
276
305
|
else:
|
|
277
306
|
colour.write(os.path.dirname(args.configuration_file))
|
|
278
307
|
|
|
@@ -442,12 +471,6 @@ def main():
|
|
|
442
471
|
# Run an internal or external command-specific validation
|
|
443
472
|
|
|
444
473
|
if args.internal_command:
|
|
445
|
-
if args.command == 'init':
|
|
446
|
-
if args.modified or args.branched:
|
|
447
|
-
error('The "--modified" and "--branched" options cannot be used with the "init" subcommand')
|
|
448
|
-
elif not config:
|
|
449
|
-
error(f'Unable to location configuration file "{args.configuration_file}"')
|
|
450
|
-
|
|
451
474
|
# Run the subcommand
|
|
452
475
|
|
|
453
476
|
commands[args.command](args, config, console)
|
|
@@ -459,6 +482,8 @@ def main():
|
|
|
459
482
|
config.write(configfile)
|
|
460
483
|
|
|
461
484
|
else:
|
|
485
|
+
# Run the external command, no need to update the config as it can't change here
|
|
486
|
+
|
|
462
487
|
run_git_command(args, config, console)
|
|
463
488
|
|
|
464
489
|
################################################################################
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: skilleter_thingy
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.94
|
|
4
4
|
Summary: A collection of useful utilities, mainly aimed at making Git more friendly
|
|
5
5
|
Author-email: John Skilleter <john@skilleter.org.uk>
|
|
6
6
|
Project-URL: Home, https://skilleter.org.uk
|
|
@@ -17,7 +17,7 @@ skilleter_thingy/git_hold.py,sha256=Zk6YUhr08znUOdpVJkJAt0rOtrCXnKE0NHoZzoaEEGo,
|
|
|
17
17
|
skilleter_thingy/git_mr.py,sha256=g33FaRtJTbIQI0tfXv_a042YpGwtbg5fKw072aqjAdw,3086
|
|
18
18
|
skilleter_thingy/git_parent.py,sha256=DLy38mo06R0YDyJWQjrP8pQS-qc7tvLYcn8unKqzEiQ,2774
|
|
19
19
|
skilleter_thingy/git_review.py,sha256=e0yvDD9fIVhscnEP7hY26Od8VUbPEb7iMVMbY63Xjbc,52462
|
|
20
|
-
skilleter_thingy/git_update.py,sha256=
|
|
20
|
+
skilleter_thingy/git_update.py,sha256=jJt66M_rVD-CJzozMgvFPp5DFjmt4yu2cU9fzlI5wFc,14184
|
|
21
21
|
skilleter_thingy/git_wt.py,sha256=Xm4VBBXMI4GxNtH3QvF-QL9rtvo4RrlWSbNQDFpGZu8,2954
|
|
22
22
|
skilleter_thingy/gitcmp_helper.py,sha256=wutDHpBPOX8ZsXbsC5ApHxMY5tOKgD3P0eyFVs_mSAI,11214
|
|
23
23
|
skilleter_thingy/gitprompt.py,sha256=SzSMd0EGI7ftPko80Q2PipwbVA-qjU1jsmdpmTCM5GI,8912
|
|
@@ -25,7 +25,7 @@ skilleter_thingy/gl.py,sha256=9zbGpKxw6lX9RghLkdy-Q5sZlqtbB3uGFO04qTu1dH8,5954
|
|
|
25
25
|
skilleter_thingy/gphotosync.py,sha256=Vb2zYTEFp26BYdkG810SRg9afyfDqvq4CLHTk-MFf60,22388
|
|
26
26
|
skilleter_thingy/linecount.py,sha256=ehTN6VD76i4U5k6dXuYoiqSRHI67_BP-bziklNAJSKY,4309
|
|
27
27
|
skilleter_thingy/moviemover.py,sha256=QzUAWQzQ1AWWREIhl-VMaLo2h8MMhOekBnao5jGWV1s,4470
|
|
28
|
-
skilleter_thingy/multigit.py,sha256=
|
|
28
|
+
skilleter_thingy/multigit.py,sha256=HYXOkcmarZslNQMHPfeomNpcRv_mVpy0fTblwHx1tGo,17858
|
|
29
29
|
skilleter_thingy/photodupe.py,sha256=l0hbzSLb2Vk2ceteg-x9fHXCEE1uUuFo84hz5rsZUPA,4184
|
|
30
30
|
skilleter_thingy/phototidier.py,sha256=BOu-cKHMivDlBqlRqv7sL3J6Ix1K2dxWWNcderldyZo,7818
|
|
31
31
|
skilleter_thingy/py_audit.py,sha256=xJm5k5qyeA6ii8mODa4dOkmP8L1drv94UHuxR54RsIM,4384
|
|
@@ -61,9 +61,9 @@ skilleter_thingy/thingy/run.py,sha256=6SNKWF01fSxzB10GMU9ajraXYZqAL1w0PXkqjJdr1U
|
|
|
61
61
|
skilleter_thingy/thingy/tfm_pane.py,sha256=oqy5zBzKwfbjbGqetbbhpKi4x5He7sl4qkmhUeqtdZc,19789
|
|
62
62
|
skilleter_thingy/thingy/tidy.py,sha256=71DCyj0VJrj52RmjQyj1eOiQJIfy5EIPHuThOrS6ZTA,5876
|
|
63
63
|
skilleter_thingy/thingy/venv_template.py,sha256=SsVNvSwojd8NnFeQaZPCRQYTNdwJRplpZpygbUEXRnY,1015
|
|
64
|
-
skilleter_thingy-0.0.
|
|
65
|
-
skilleter_thingy-0.0.
|
|
66
|
-
skilleter_thingy-0.0.
|
|
67
|
-
skilleter_thingy-0.0.
|
|
68
|
-
skilleter_thingy-0.0.
|
|
69
|
-
skilleter_thingy-0.0.
|
|
64
|
+
skilleter_thingy-0.0.94.dist-info/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
|
|
65
|
+
skilleter_thingy-0.0.94.dist-info/METADATA,sha256=X0akBir0A11H1PmDBcm6hnfStNhZUcMXJxGMLaK8MVk,8894
|
|
66
|
+
skilleter_thingy-0.0.94.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
67
|
+
skilleter_thingy-0.0.94.dist-info/entry_points.txt,sha256=u5ymS-KPljIGTnprV5yJsAjz7qgeT2BZ-Qo_Con_PFM,2145
|
|
68
|
+
skilleter_thingy-0.0.94.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
|
|
69
|
+
skilleter_thingy-0.0.94.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|