skilleter-thingy 0.0.92__tar.gz → 0.0.94__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.

Potentially problematic release.


This version of skilleter-thingy might be problematic. Click here for more details.

Files changed (74) hide show
  1. {skilleter_thingy-0.0.92/skilleter_thingy.egg-info → skilleter_thingy-0.0.94}/PKG-INFO +1 -1
  2. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/pyproject.toml +1 -1
  3. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/git_update.py +8 -8
  4. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/multigit.py +47 -22
  5. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94/skilleter_thingy.egg-info}/PKG-INFO +1 -1
  6. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/LICENSE +0 -0
  7. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/README.md +0 -0
  8. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/setup.cfg +0 -0
  9. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/__init__.py +0 -0
  10. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/addpath.py +0 -0
  11. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/borger.py +0 -0
  12. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/box.py +0 -0
  13. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/console_colours.py +0 -0
  14. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/diskspacecheck.py +0 -0
  15. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/docker_purge.py +0 -0
  16. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/ffind.py +0 -0
  17. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/ggit.py +0 -0
  18. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/ggrep.py +0 -0
  19. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/git_br.py +0 -0
  20. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/git_ca.py +0 -0
  21. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/git_cleanup.py +0 -0
  22. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/git_co.py +0 -0
  23. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/git_common.py +0 -0
  24. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/git_hold.py +0 -0
  25. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/git_mr.py +0 -0
  26. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/git_parent.py +0 -0
  27. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/git_review.py +0 -0
  28. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/git_wt.py +0 -0
  29. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/gitcmp_helper.py +0 -0
  30. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/gitprompt.py +0 -0
  31. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/gl.py +0 -0
  32. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/gphotosync.py +0 -0
  33. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/linecount.py +0 -0
  34. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/moviemover.py +0 -0
  35. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/photodupe.py +0 -0
  36. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/phototidier.py +0 -0
  37. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/py_audit.py +0 -0
  38. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/readable.py +0 -0
  39. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/remdir.py +0 -0
  40. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/rmdupe.py +0 -0
  41. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/rpylint.py +0 -0
  42. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/splitpics.py +0 -0
  43. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/strreplace.py +0 -0
  44. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/sysmon.py +0 -0
  45. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/tfm.py +0 -0
  46. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/tfparse.py +0 -0
  47. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/__init__.py +0 -0
  48. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/colour.py +0 -0
  49. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/dc_curses.py +0 -0
  50. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/dc_defaults.py +0 -0
  51. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/dc_util.py +0 -0
  52. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/dircolors.py +0 -0
  53. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/docker.py +0 -0
  54. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/files.py +0 -0
  55. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/git.py +0 -0
  56. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/git2.py +0 -0
  57. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/gitlab.py +0 -0
  58. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/path.py +0 -0
  59. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/popup.py +0 -0
  60. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/process.py +0 -0
  61. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/run.py +0 -0
  62. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/tfm_pane.py +0 -0
  63. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/tidy.py +0 -0
  64. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/thingy/venv_template.py +0 -0
  65. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/trimpath.py +0 -0
  66. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/venv_create.py +0 -0
  67. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/window_rename.py +0 -0
  68. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/xchmod.py +0 -0
  69. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy/yamlcheck.py +0 -0
  70. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy.egg-info/SOURCES.txt +0 -0
  71. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy.egg-info/dependency_links.txt +0 -0
  72. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy.egg-info/entry_points.txt +0 -0
  73. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy.egg-info/requires.txt +0 -0
  74. {skilleter_thingy-0.0.92 → skilleter_thingy-0.0.94}/skilleter_thingy.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: skilleter_thingy
3
- Version: 0.0.92
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
@@ -7,7 +7,7 @@ name = "skilleter_thingy"
7
7
 
8
8
  # Version must be incremented to install updated Thingy
9
9
 
10
- version = "0.0.92"
10
+ version = "0.0.94"
11
11
 
12
12
  authors = [
13
13
  {name="John Skilleter", email="john@skilleter.org.uk"},
@@ -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:%s] branch as unable to determine its parent (could be any of %s)'
108
- % (branch, ', '.join(parents)), indent=4)
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' % ', '.join(branches))
299
+ logging.info('Updating %s', ', '.join(branches))
300
300
 
301
301
  # Filter out branches that the user wants to ignore
302
302
 
@@ -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
- # TODO: -j option to run in parallel?
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
- # DONE: Better error-handling - e.g. continue/abort option after failure in one repo
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
- search_dir = args.parameters[0]
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'], search_dir):
281
+ if fnmatch.fnmatch(repo['repo name'], search_name):
268
282
  location.append(repo.name)
269
283
 
270
- if len(location) == 0:
271
- error(f'No matches with [BLUE:{search_dir}]')
272
- elif len(location) > 1:
273
- error(f'Multiple matches with [BLUE:{search_dir}] - {" ".join(location)}')
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
- colour.write(os.path.join(os.path.dirname(args.configuration_file), location[0]))
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.92
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