skilleter-thingy 0.2.1__tar.gz → 0.2.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.

Potentially problematic release.


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

Files changed (76) hide show
  1. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/PKG-INFO +1 -46
  2. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/README.md +0 -45
  3. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/pyproject.toml +1 -10
  4. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/ggit.py +0 -1
  5. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/ggrep.py +0 -1
  6. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/git_br.py +0 -7
  7. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/git_ca.py +0 -8
  8. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/git_cleanup.py +0 -11
  9. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/git_co.py +3 -8
  10. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/git_common.py +4 -12
  11. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/git_hold.py +0 -9
  12. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/git_mr.py +0 -11
  13. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/git_parent.py +18 -23
  14. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/git_retag.py +0 -10
  15. skilleter_thingy-0.2.3/skilleter_thingy/git_retag.sync-conflict-20250928-192600-TVSLRWK.py +54 -0
  16. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/git_review.py +0 -1
  17. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/git_update.py +0 -1
  18. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/git_wt.py +0 -2
  19. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/gitprompt.py +0 -1
  20. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/git.py +5 -18
  21. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/git2.py +7 -20
  22. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy.egg-info/PKG-INFO +1 -46
  23. skilleter_thingy-0.2.3/skilleter_thingy.egg-info/PKG-INFO 2 +193 -0
  24. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy.egg-info/SOURCES.txt +2 -9
  25. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy.egg-info/entry_points.txt +0 -9
  26. skilleter_thingy-0.2.1/skilleter_thingy/borger.py +0 -273
  27. skilleter_thingy-0.2.1/skilleter_thingy/diskspacecheck.py +0 -67
  28. skilleter_thingy-0.2.1/skilleter_thingy/localphotosync.py +0 -201
  29. skilleter_thingy-0.2.1/skilleter_thingy/moviemover.py +0 -133
  30. skilleter_thingy-0.2.1/skilleter_thingy/photodupe.py +0 -135
  31. skilleter_thingy-0.2.1/skilleter_thingy/phototidier.py +0 -248
  32. skilleter_thingy-0.2.1/skilleter_thingy/splitpics.py +0 -99
  33. skilleter_thingy-0.2.1/skilleter_thingy/sysmon.py +0 -435
  34. skilleter_thingy-0.2.1/skilleter_thingy/window_rename.py +0 -92
  35. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/LICENSE +0 -0
  36. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/setup.cfg +0 -0
  37. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/__init__.py +0 -0
  38. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/addpath.py +0 -0
  39. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/console_colours.py +0 -0
  40. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/docker_purge.py +0 -0
  41. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/ffind.py +0 -0
  42. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/gitcmp_helper.py +0 -0
  43. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/gl.py +0 -0
  44. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/linecount.py +0 -0
  45. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/multigit.py +0 -0
  46. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/py_audit.py +0 -0
  47. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/readable.py +0 -0
  48. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/remdir.py +0 -0
  49. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/rmdupe.py +0 -0
  50. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/rpylint.py +0 -0
  51. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/strreplace.py +0 -0
  52. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/tfm.py +0 -0
  53. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/tfparse.py +0 -0
  54. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/__init__.py +0 -0
  55. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/colour.py +0 -0
  56. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/dc_curses.py +0 -0
  57. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/dc_defaults.py +0 -0
  58. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/dc_util.py +0 -0
  59. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/dircolors.py +0 -0
  60. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/docker.py +0 -0
  61. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/files.py +0 -0
  62. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/gitlab.py +0 -0
  63. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/path.py +0 -0
  64. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/popup.py +0 -0
  65. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/process.py +0 -0
  66. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/run.py +0 -0
  67. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/tfm_pane.py +0 -0
  68. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/tidy.py +0 -0
  69. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/thingy/venv_template.py +0 -0
  70. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/trimpath.py +0 -0
  71. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/venv_create.py +0 -0
  72. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/xchmod.py +0 -0
  73. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy/yamlcheck.py +0 -0
  74. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy.egg-info/dependency_links.txt +0 -0
  75. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy.egg-info/requires.txt +0 -0
  76. {skilleter_thingy-0.2.1 → skilleter_thingy-0.2.3}/skilleter_thingy.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: skilleter_thingy
3
- Version: 0.2.1
3
+ Version: 0.2.3
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
@@ -597,55 +597,10 @@ YAML validator - checks that a file is valid YAML (use yamllint to verify that i
597
597
 
598
598
  These will be moved to the skilleter-extras package in due course.
599
599
 
600
- ## borger
601
-
602
- Wrapper for the borg backup utility to make it easier to use with a fixed set of options.
603
-
604
600
  ## consolecolours
605
601
 
606
602
  Display all available colours in the console.
607
603
 
608
- ## diskspacecheck
609
-
610
- Check how much free space is available on all filesystems, ignoring read-only filesystems, /dev and tmpfs.
611
-
612
- Issue a warning if any are above 90% used.
613
-
614
- ## gphotosync & localphotosync
615
-
616
- Utilities for syncing photos from Google Photos or a local directory to local storage
617
-
618
- ## moviemover
619
-
620
- Search for files matching a wildcard in a directory tree and move them to an equivalent location in a different tree
621
-
622
- ## phototidier
623
-
624
- Perform various tidying operations on a directory full of photos:
625
-
626
- * Remove leading '$' and '_' from filenames
627
- * Move files in hidden directories up 1 level
628
- * If the EXIF data in a photo indicates that it was taken on date that doesn't match the name of the directory it is stored in (in YYYY-MM-DD format) then it is moved to the correct directory, creating it if necessary.
629
-
630
- All move/rename operations are carried out safely with the file being moved having
631
- a numeric suffix added to the name if it conflicts with an existing file.
632
-
633
- ## photodupe
634
-
635
- Search for duplicate images in a directory tree
636
-
637
- ## splitpics
638
-
639
- Copy a directory full of pictures to a destination, creating subdiretories with a fixed number of pictures in each in the destination directory for use with FAT filesystems and digital photo frames.
640
-
641
- ## sysmon
642
-
643
- Simple console system monitor
644
-
645
- ## window-rename
646
-
647
- Monitor window titles and rename them to fit an alphabetical grouping in 'Appname - Document' format.
648
-
649
604
  # Obsolescent Commands
650
605
 
651
606
  These commands will probably be retired in future versions of Thingy
@@ -574,55 +574,10 @@ YAML validator - checks that a file is valid YAML (use yamllint to verify that i
574
574
 
575
575
  These will be moved to the skilleter-extras package in due course.
576
576
 
577
- ## borger
578
-
579
- Wrapper for the borg backup utility to make it easier to use with a fixed set of options.
580
-
581
577
  ## consolecolours
582
578
 
583
579
  Display all available colours in the console.
584
580
 
585
- ## diskspacecheck
586
-
587
- Check how much free space is available on all filesystems, ignoring read-only filesystems, /dev and tmpfs.
588
-
589
- Issue a warning if any are above 90% used.
590
-
591
- ## gphotosync & localphotosync
592
-
593
- Utilities for syncing photos from Google Photos or a local directory to local storage
594
-
595
- ## moviemover
596
-
597
- Search for files matching a wildcard in a directory tree and move them to an equivalent location in a different tree
598
-
599
- ## phototidier
600
-
601
- Perform various tidying operations on a directory full of photos:
602
-
603
- * Remove leading '$' and '_' from filenames
604
- * Move files in hidden directories up 1 level
605
- * If the EXIF data in a photo indicates that it was taken on date that doesn't match the name of the directory it is stored in (in YYYY-MM-DD format) then it is moved to the correct directory, creating it if necessary.
606
-
607
- All move/rename operations are carried out safely with the file being moved having
608
- a numeric suffix added to the name if it conflicts with an existing file.
609
-
610
- ## photodupe
611
-
612
- Search for duplicate images in a directory tree
613
-
614
- ## splitpics
615
-
616
- Copy a directory full of pictures to a destination, creating subdiretories with a fixed number of pictures in each in the destination directory for use with FAT filesystems and digital photo frames.
617
-
618
- ## sysmon
619
-
620
- Simple console system monitor
621
-
622
- ## window-rename
623
-
624
- Monitor window titles and rename them to fit an alphabetical grouping in 'Appname - Document' format.
625
-
626
581
  # Obsolescent Commands
627
582
 
628
583
  These commands will probably be retired in future versions of Thingy
@@ -7,7 +7,7 @@ name = "skilleter_thingy"
7
7
 
8
8
  # Version must be incremented to install updated Thingy
9
9
 
10
- version = "0.2.1"
10
+ version = "0.2.3"
11
11
 
12
12
  authors = [
13
13
  {name="John Skilleter", email="john@skilleter.org.uk"},
@@ -42,9 +42,7 @@ Home = "https://skilleter.org.uk"
42
42
 
43
43
  [project.scripts]
44
44
  addpath = "skilleter_thingy:addpath.addpath"
45
- borger = "skilleter_thingy:borger.borger"
46
45
  consolecolours = "skilleter_thingy:console_colours.console_colours"
47
- diskspacecheck = "skilleter_thingy:diskspacecheck.diskspacecheck"
48
46
  docker-purge = "skilleter_thingy:docker_purge.docker_purge"
49
47
  ffind = "skilleter_thingy:ffind.ffind"
50
48
  ggit = "skilleter_thingy:ggit.ggit"
@@ -66,26 +64,19 @@ gitprompt = "skilleter_thingy:gitprompt.gitprompt"
66
64
  gl = "skilleter_thingy:gl.gl"
67
65
  gphotosync = "skilleter_thingy:gphotosync.gphotosync"
68
66
  linecount = "skilleter_thingy:linecount.linecount"
69
- localphotosync = "skilleter_thingy:localphotosync.localphotosync"
70
67
  mg = "skilleter_thingy:mg.mg"
71
- moviemover = "skilleter_thingy:moviemover.moviemover"
72
68
  multigit = "skilleter_thingy:multigit.multigit"
73
- photodupe = "skilleter_thingy:photodupe.photodupe"
74
- phototidier = "skilleter_thingy:phototidier.phototidier"
75
69
  py-audit = "skilleter_thingy:py_audit.py_audit"
76
70
  readable = "skilleter_thingy:readable.readable"
77
71
  remdir = "skilleter_thingy:remdir.remdir"
78
72
  rmdupe = "skilleter_thingy:rmdupe.rmdupe"
79
73
  rpylint = "skilleter_thingy:rpylint.rpylint"
80
74
  s3-sync = "skilleter_thingy:s3_sync.s3_sync"
81
- splitpics = "skilleter_thingy:splitpics.splitpics"
82
75
  strreplace = "skilleter_thingy:strreplace.strreplace"
83
- sysmon = "skilleter_thingy:sysmon.sysmon"
84
76
  tfm = "skilleter_thingy:tfm.tfm"
85
77
  tfparse = "skilleter_thingy:tfparse.tfparse"
86
78
  trimpath = "skilleter_thingy:trimpath.trimpath"
87
79
  venv-create = "skilleter_thingy:venv_create.venv_create"
88
80
  webwatch = "skilleter_thingy:webwatch.webwatch"
89
- window-rename = "skilleter_thingy:window_rename.window_rename"
90
81
  xchmod = "skilleter_thingy:xchmod.xchmod"
91
82
  yamlcheck = "skilleter_thingy:yamlcheck.yamlcheck"
@@ -7,7 +7,6 @@ import os
7
7
  import subprocess
8
8
  import argparse
9
9
 
10
- # TODO: Update to git2
11
10
  import thingy.git as git
12
11
  import thingy.colour as colour
13
12
 
@@ -14,7 +14,6 @@ import sys
14
14
  import argparse
15
15
 
16
16
  import thingy.colour as colour
17
- # TODO: Update to git2
18
17
  import thingy.git as git
19
18
 
20
19
  ################################################################################
@@ -13,7 +13,6 @@
13
13
  """
14
14
  ################################################################################
15
15
 
16
- import os
17
16
  import sys
18
17
  import argparse
19
18
  import fnmatch
@@ -22,7 +21,6 @@ import datetime
22
21
  from dateutil.parser import parse
23
22
  from dateutil.relativedelta import relativedelta
24
23
 
25
- # TODO: Update to git2
26
24
  import thingy.git as git
27
25
  import thingy.colour as colour
28
26
 
@@ -36,15 +34,10 @@ def parse_command_line():
36
34
  parser.add_argument('--all', '-a', action='store_true', help='List all branches, including remotes')
37
35
  parser.add_argument('--delete', '-d', action='store_true',
38
36
  help='Delete the specified branch(es), even if it is the current one (list of branches to delete must be supplied as parameters)')
39
- parser.add_argument('--path', '-C', nargs=1, type=str, default=None,
40
- help='Run the command in the specified directory')
41
37
  parser.add_argument('branches', nargs='*', help='Filter the list of branches according to one or more patterns')
42
38
 
43
39
  args = parser.parse_args()
44
40
 
45
- if args.path:
46
- os.chdir(args.path[0])
47
-
48
41
  if args.delete and not args.branches:
49
42
  colour.error('You must specify the branches to delete', prefix=True)
50
43
 
@@ -18,7 +18,6 @@ import sys
18
18
  import logging
19
19
 
20
20
  import thingy.colour as colour
21
- # TODO: Update to git2
22
21
  import thingy.git as git
23
22
 
24
23
  ################################################################################
@@ -44,8 +43,6 @@ def main():
44
43
  parser.add_argument('--patch', '-p', action='store_true', help='Use the interactive patch selection interface to chose which changes to commit.')
45
44
  parser.add_argument('--verbose', '-v', action='store_true', help='Verbose mode')
46
45
  parser.add_argument('--dry-run', '-D', action='store_true', help='Dry-run')
47
- parser.add_argument('--path', '-C', nargs=1, type=str, default=None,
48
- help='Run the command in the specified directory')
49
46
 
50
47
  parser.add_argument('files', nargs='*', help='List of files to add to the commit')
51
48
 
@@ -57,11 +54,6 @@ def main():
57
54
  logging.basicConfig(level=logging.INFO)
58
55
  logging.info('Debug logging enabled')
59
56
 
60
- # Change directory, if specified
61
-
62
- if args.path:
63
- os.chdir(args.path[0])
64
-
65
57
  # 'Add' implies 'all'
66
58
 
67
59
  if args.everything:
@@ -9,12 +9,10 @@
9
9
  """
10
10
  ################################################################################
11
11
 
12
- import os
13
12
  import sys
14
13
  import argparse
15
14
  import logging
16
15
 
17
- # TODO: Update to git2
18
16
  import thingy.git as git
19
17
  import thingy.colour as colour
20
18
 
@@ -40,8 +38,6 @@ def parse_command_line():
40
38
  parser.add_argument('--unmerged', '-u', action='store_true', dest='list_unmerged', help='List branches that have NOT been merged')
41
39
  parser.add_argument('--yes', '-y', action='store_true', dest='force', help='Assume "yes" in response to any prompts (e.g. to delete branches)')
42
40
  parser.add_argument('--debug', action='store_true', help='Enable debug output')
43
- parser.add_argument('--path', '-C', nargs=1, type=str, default=None,
44
- help='Run the command in the specified directory')
45
41
 
46
42
  parser.add_argument('branches', nargs='*', help='List of branches to check (default is all branches)')
47
43
 
@@ -98,11 +94,6 @@ def main():
98
94
  if args.debug:
99
95
  logging.basicConfig(level=logging.INFO)
100
96
 
101
- # Change directory, if specified
102
-
103
- if args.path:
104
- os.chdir(args.path[0])
105
-
106
97
  # Get the list of all local branches
107
98
 
108
99
  try:
@@ -289,8 +280,6 @@ def git_cleanup():
289
280
  sys.exit(1)
290
281
  except BrokenPipeError:
291
282
  sys.exit(2)
292
- except git.GitError as exc:
293
- colour.error(exc.msg, status=exc.status, prefix=True)
294
283
 
295
284
  ################################################################################
296
285
 
@@ -20,7 +20,6 @@
20
20
  """
21
21
  ################################################################################
22
22
 
23
- import os
24
23
  import logging
25
24
  import sys
26
25
  import argparse
@@ -69,8 +68,6 @@ def parse_arguments():
69
68
  parser.add_argument('--debug', action='store_true', help='Enable debug output')
70
69
  parser.add_argument('branchname', nargs=1, type=str,
71
70
  help='The branch name (or a partial name that matches uniquely against a local branch, remote branch, commit ID or tag)')
72
- parser.add_argument('--path', '-C', nargs=1, type=str, default=None,
73
- help='Run the command in the specified directory')
74
71
 
75
72
  args = parser.parse_args()
76
73
 
@@ -79,9 +76,6 @@ def parse_arguments():
79
76
  if args.debug:
80
77
  logging.basicConfig(level=logging.INFO)
81
78
 
82
- if args.path:
83
- os.chdir(args.path[0])
84
-
85
79
  return args
86
80
 
87
81
  ################################################################################
@@ -204,6 +198,9 @@ def main():
204
198
  else:
205
199
  checkout_matching_branch(args, args.branchname[0])
206
200
 
201
+ except git.GitError as exc:
202
+ colour.error(exc.msg, exc.status)
203
+
207
204
  ################################################################################
208
205
 
209
206
  def git_co():
@@ -216,8 +213,6 @@ def git_co():
216
213
  sys.exit(1)
217
214
  except BrokenPipeError:
218
215
  sys.exit(2)
219
- except git.GitError as exc:
220
- colour.error(exc.msg, status=exc.status, prefix=True)
221
216
 
222
217
  ################################################################################
223
218
 
@@ -6,12 +6,10 @@ Report the oldest commit in common in the history of two commits
6
6
 
7
7
  ################################################################################
8
8
 
9
- import os
10
9
  import sys
11
10
  import argparse
12
11
 
13
12
  import thingy.colour as colour
14
- # TODO: Update to git2
15
13
  import thingy.git as git
16
14
 
17
15
  ################################################################################
@@ -23,8 +21,6 @@ def main():
23
21
 
24
22
  parser.add_argument('--short', '-s', action='store_true', help='Just output the ancestor commit ID')
25
23
  parser.add_argument('--long', '-l', action='store_true', help='Output the log entry for the commit')
26
- parser.add_argument('--path', '-C', nargs=1, type=str, default=None,
27
- help='Run the command in the specified directory')
28
24
  parser.add_argument('commit1', nargs='?', default='HEAD', help='First commit (default=HEAD)')
29
25
  parser.add_argument('commit2', nargs='?', default='master', help='Second commit (default=master)')
30
26
 
@@ -33,12 +29,10 @@ def main():
33
29
  if args.long and args.short:
34
30
  colour.error('The [BLUE:--long] and [BLUE:--short] options cannot be used together', prefix=True)
35
31
 
36
- # Change directory, if specified
37
-
38
- if args.path:
39
- os.chdir(args.path[0])
40
-
41
- ancestor = git.find_common_ancestor(args.commit1, args.commit2)
32
+ try:
33
+ ancestor = git.find_common_ancestor(args.commit1, args.commit2)
34
+ except git.GitError as exc:
35
+ colour.error(exc, status=exc.status, prefix=True)
42
36
 
43
37
  if args.short:
44
38
  print(ancestor)
@@ -60,8 +54,6 @@ def git_common():
60
54
  sys.exit(1)
61
55
  except BrokenPipeError:
62
56
  sys.exit(2)
63
- except git.GitError as exc:
64
- colour.error(exc.msg, status=exc.status, prefix=True)
65
57
 
66
58
  ################################################################################
67
59
 
@@ -2,13 +2,11 @@
2
2
  """Archive one or more branches by tagging the branch then deleting it
3
3
  The branch tag is 'archive/BRANCH_NAME'"""
4
4
 
5
- import os
6
5
  import sys
7
6
  import argparse
8
7
  import fnmatch
9
8
 
10
9
  import thingy.colour as colour
11
- # TODO: Update to git2
12
10
  import thingy.git as git
13
11
 
14
12
  ################################################################################
@@ -120,8 +118,6 @@ def main():
120
118
  parser = argparse.ArgumentParser(description='Archive, list or recover one or more Git branches')
121
119
  parser.add_argument('--list', '-l', action='store_true', help='List archived branches')
122
120
  parser.add_argument('--restore', '-r', action='store_true', help='Restore archived branches')
123
- parser.add_argument('--path', '-C', nargs=1, type=str, default=None,
124
- help='Run the command in the specified directory')
125
121
  parser.add_argument('branches', nargs='*', help='Branches')
126
122
 
127
123
  args = parser.parse_args()
@@ -132,9 +128,6 @@ def main():
132
128
  if not args.branches and not args.list:
133
129
  colour.error('No branches specified', prefix=True)
134
130
 
135
- if args.path:
136
- os.chdir(args.path[0])
137
-
138
131
  if args.list:
139
132
  list_archive_branches(args.branches)
140
133
  elif args.restore:
@@ -154,8 +147,6 @@ def git_hold():
154
147
  sys.exit(1)
155
148
  except BrokenPipeError:
156
149
  sys.exit(2)
157
- except git.GitError as exc:
158
- colour.error(exc.msg, status=exc.status, prefix=True)
159
150
 
160
151
  ################################################################################
161
152
 
@@ -4,12 +4,10 @@
4
4
  """ Push to Gitlab and create a merge request at the same time """
5
5
  ################################################################################
6
6
 
7
- import os
8
7
  import logging
9
8
  import sys
10
9
  import argparse
11
10
 
12
- # TODO: Update to git2
13
11
  import thingy.git as git
14
12
  import thingy.colour as colour
15
13
 
@@ -29,8 +27,6 @@ def parse_arguments():
29
27
  parser.add_argument('--parent', '-p', action='store', help='Override the default parent and specify the branch to merge onto')
30
28
  parser.add_argument('--reviewer', '-r', action='store', help='Specify the name of the reviewer for the merge request')
31
29
  parser.add_argument('--keep', '-k', action='store_true', help='Keep the source branch after the merge (default is to delete it).')
32
- parser.add_argument('--path', '-C', nargs=1, type=str, default=None,
33
- help='Run the command in the specified directory')
34
30
 
35
31
  args = parser.parse_args()
36
32
 
@@ -39,11 +35,6 @@ def parse_arguments():
39
35
  if args.debug:
40
36
  logging.basicConfig(level=logging.INFO)
41
37
 
42
- # Change directory, if specified
43
-
44
- if args.path:
45
- os.chdir(args.path[0])
46
-
47
38
  return args
48
39
 
49
40
  ################################################################################
@@ -95,8 +86,6 @@ def git_mr():
95
86
  sys.exit(1)
96
87
  except BrokenPipeError:
97
88
  sys.exit(2)
98
- except git.GitError as exc:
99
- colour.error(exc.msg, status=exc.status, prefix=True)
100
89
 
101
90
  ################################################################################
102
91
 
@@ -7,11 +7,9 @@ the same commit. Can optionally ignore feature branches and/or report
7
7
  the distance to the potential parent.
8
8
  """
9
9
 
10
- import os
11
10
  import argparse
12
11
  import sys
13
12
 
14
- # TODO: Update to git2
15
13
  import thingy.git as git
16
14
  import thingy.colour as colour
17
15
 
@@ -25,34 +23,33 @@ def main():
25
23
  parser = argparse.ArgumentParser(description='Attempt to determine the parent branch for the specified branch (defaulting to the current one)')
26
24
  parser.add_argument('--all', '-a', action='store_true', help='Include feature branches as possible parents')
27
25
  parser.add_argument('--verbose', '-v', action='store_true', help='Report verbose results (includes number of commits between branch and parent)')
28
- parser.add_argument('--path', '-C', nargs=1, type=str, default=None,
29
- help='Run the command in the specified directory')
30
26
  parser.add_argument('branch', action='store', nargs='?', type=str, default=current_branch,
31
27
  help=f'Branch, commit or commit (defaults to current branch; {current_branch})')
32
28
 
33
29
  args = parser.parse_args()
34
30
 
35
- if args.path:
36
- os.chdir(args.path[0])
31
+ try:
32
+ if args.all:
33
+ any_parents, any_distance = git.parents(args.branch)
34
+ else:
35
+ any_parents = []
37
36
 
38
- if args.all:
39
- any_parents, any_distance = git.parents(args.branch)
40
- else:
41
- any_parents = []
37
+ parents, distance = git.parents(args.branch, ignore='feature/*')
42
38
 
43
- parents, distance = git.parents(args.branch, ignore='feature/*')
39
+ # If we have feature and non-feature branch candidates, decide which to report
40
+ # (one or both) based on distance.
44
41
 
45
- # If we have feature and non-feature branch candidates, decide which to report
46
- # (one or both) based on distance.
42
+ if parents and any_parents:
43
+ if any_distance < distance:
44
+ parents = any_parents
45
+ distance = any_distance
46
+ elif any_distance == distance:
47
+ for more in any_parents:
48
+ if more not in parents:
49
+ parents.append(more)
47
50
 
48
- if parents and any_parents:
49
- if any_distance < distance:
50
- parents = any_parents
51
- distance = any_distance
52
- elif any_distance == distance:
53
- for more in any_parents:
54
- if more not in parents:
55
- parents.append(more)
51
+ except git.GitError as exc:
52
+ colour.error(exc.msg, status=exc.status, prefix=True)
56
53
 
57
54
  if parents:
58
55
  if args.verbose:
@@ -76,8 +73,6 @@ def git_parent():
76
73
  sys.exit(1)
77
74
  except BrokenPipeError:
78
75
  sys.exit(2)
79
- except git.GitError as exc:
80
- colour.error(exc.msg, status=exc.status, prefix=True)
81
76
 
82
77
  ################################################################################
83
78
 
@@ -9,7 +9,6 @@
9
9
  """
10
10
  ################################################################################
11
11
 
12
- import os
13
12
  import sys
14
13
  import argparse
15
14
 
@@ -24,17 +23,10 @@ def main():
24
23
 
25
24
  parser = argparse.ArgumentParser(description='Apply or update a tag, optionally updating it on the remote as well.')
26
25
  parser.add_argument('--push', '-p', action='store_true', help='Push the tag to the remote')
27
- parser.add_argument('--path', '-C', nargs=1, type=str, default=None,
28
- help='Run the command in the specified directory')
29
26
  parser.add_argument('tag', nargs=1, help='The tag')
30
27
 
31
28
  args = parser.parse_args()
32
29
 
33
- # Change directory, if specified
34
-
35
- if args.path:
36
- os.chdir(args.path[0])
37
-
38
30
  tag = args.tag[0]
39
31
 
40
32
  # Delete the tag if it currently exists, optionally pushing the deletion
@@ -57,8 +49,6 @@ def git_retag():
57
49
  sys.exit(1)
58
50
  except BrokenPipeError:
59
51
  sys.exit(2)
60
- except git.GitError as exc:
61
- colour.error(exc.msg, status=exc.status, prefix=True)
62
52
 
63
53
  ################################################################################
64
54
 
@@ -0,0 +1,54 @@
1
+ #! /usr/bin/env python3
2
+
3
+ ################################################################################
4
+ """ Apply or update a tag, optionally updating it on the remote as well.
5
+
6
+ Copyright (C) 2025 John Skilleter
7
+
8
+ Licence: GPL v3 or later
9
+ """
10
+ ################################################################################
11
+
12
+ import sys
13
+ import argparse
14
+
15
+ import thingy.git2 as git
16
+
17
+ ################################################################################
18
+
19
+ def main():
20
+ """ Main function """
21
+
22
+ # Command line parameters
23
+
24
+ parser = argparse.ArgumentParser(description='Apply or update a tag, optionally updating it on the remote as well.')
25
+ parser.add_argument('--push', '-p', action='store_true', help='Push the tag to the remote')
26
+ parser.add_argument('tag', nargs=1, help='The tag')
27
+
28
+ args = parser.parse_args()
29
+
30
+ # Delete the tag if it currently exists, optionally pushing the deletion
31
+
32
+ if args.tag in git.tags():
33
+ git.tag_delete(args.tag, push=args.push)
34
+
35
+ # Apply the tag
36
+
37
+ git.tag_apply(args.tag, push=args.push)
38
+
39
+ ################################################################################
40
+
41
+ def git_retag():
42
+ """Entry point"""
43
+
44
+ try:
45
+ main()
46
+ except KeyboardInterrupt:
47
+ sys.exit(1)
48
+ except BrokenPipeError:
49
+ sys.exit(2)
50
+
51
+ ################################################################################
52
+
53
+ if __name__ == '__main__':
54
+ git_retag()
@@ -54,7 +54,6 @@ import subprocess
54
54
  import time
55
55
  from enum import IntEnum
56
56
 
57
- # TODO: Update to git2
58
57
  import thingy.git as git
59
58
  import thingy.dc_curses as dc_curses
60
59
  import thingy.colour as colour
@@ -27,7 +27,6 @@ import argparse
27
27
  import fnmatch
28
28
  import logging
29
29
 
30
- # TODO: Update to git2
31
30
  import thingy.git as git
32
31
  import thingy.colour as colour
33
32
 
@@ -62,8 +62,6 @@ def git_wt():
62
62
  sys.exit(1)
63
63
  except BrokenPipeError:
64
64
  sys.exit(2)
65
- except git.GitError as exc:
66
- colour.error(exc.msg, status=exc.status, prefix=True)
67
65
 
68
66
  ################################################################################
69
67
 
@@ -49,7 +49,6 @@ import os
49
49
  import sys
50
50
  import argparse
51
51
 
52
- # TODO: Update to git2
53
52
  import thingy.git as git
54
53
  import thingy.colour as colour
55
54