skilleter-thingy 0.1.29__tar.gz → 0.1.31__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.
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/PKG-INFO +1 -1
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/pyproject.toml +1 -1
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/ggit.py +1 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/ggrep.py +1 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/git_br.py +7 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/git_ca.py +8 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/git_cleanup.py +11 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/git_co.py +8 -3
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/git_common.py +12 -4
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/git_hold.py +9 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/git_mr.py +11 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/git_parent.py +23 -18
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/git_retag.py +10 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/git_review.py +1 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/git_update.py +1 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/git_wt.py +2 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/gitprompt.py +1 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/localphotosync.py +17 -7
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/git.py +18 -5
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/git2.py +20 -7
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy.egg-info/PKG-INFO +1 -1
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/LICENSE +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/README.md +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/setup.cfg +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/__init__.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/addpath.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/borger.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/console_colours.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/diskspacecheck.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/docker_purge.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/ffind.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/gitcmp_helper.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/gl.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/linecount.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/moviemover.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/multigit.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/photodupe.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/phototidier.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/py_audit.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/readable.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/remdir.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/rmdupe.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/rpylint.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/splitpics.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/strreplace.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/sysmon.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/tfm.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/tfparse.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/__init__.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/colour.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/dc_curses.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/dc_defaults.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/dc_util.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/dircolors.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/docker.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/files.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/gitlab.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/path.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/popup.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/process.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/run.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/tfm_pane.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/tidy.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/venv_template.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/trimpath.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/venv_create.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/window_rename.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/xchmod.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/yamlcheck.py +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy.egg-info/SOURCES.txt +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy.egg-info/dependency_links.txt +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy.egg-info/entry_points.txt +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy.egg-info/requires.txt +0 -0
- {skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/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.1.
|
|
3
|
+
Version: 0.1.31
|
|
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
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"""
|
|
14
14
|
################################################################################
|
|
15
15
|
|
|
16
|
+
import os
|
|
16
17
|
import sys
|
|
17
18
|
import argparse
|
|
18
19
|
import fnmatch
|
|
@@ -21,6 +22,7 @@ import datetime
|
|
|
21
22
|
from dateutil.parser import parse
|
|
22
23
|
from dateutil.relativedelta import relativedelta
|
|
23
24
|
|
|
25
|
+
# TODO: Update to git2
|
|
24
26
|
import thingy.git as git
|
|
25
27
|
import thingy.colour as colour
|
|
26
28
|
|
|
@@ -34,10 +36,15 @@ def parse_command_line():
|
|
|
34
36
|
parser.add_argument('--all', '-a', action='store_true', help='List all branches, including remotes')
|
|
35
37
|
parser.add_argument('--delete', '-d', action='store_true',
|
|
36
38
|
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')
|
|
37
41
|
parser.add_argument('branches', nargs='*', help='Filter the list of branches according to one or more patterns')
|
|
38
42
|
|
|
39
43
|
args = parser.parse_args()
|
|
40
44
|
|
|
45
|
+
if args.path:
|
|
46
|
+
os.chdir(args.path[0])
|
|
47
|
+
|
|
41
48
|
if args.delete and not args.branches:
|
|
42
49
|
colour.error('You must specify the branches to delete', prefix=True)
|
|
43
50
|
|
|
@@ -18,6 +18,7 @@ import sys
|
|
|
18
18
|
import logging
|
|
19
19
|
|
|
20
20
|
import thingy.colour as colour
|
|
21
|
+
# TODO: Update to git2
|
|
21
22
|
import thingy.git as git
|
|
22
23
|
|
|
23
24
|
################################################################################
|
|
@@ -43,6 +44,8 @@ def main():
|
|
|
43
44
|
parser.add_argument('--patch', '-p', action='store_true', help='Use the interactive patch selection interface to chose which changes to commit.')
|
|
44
45
|
parser.add_argument('--verbose', '-v', action='store_true', help='Verbose mode')
|
|
45
46
|
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')
|
|
46
49
|
|
|
47
50
|
parser.add_argument('files', nargs='*', help='List of files to add to the commit')
|
|
48
51
|
|
|
@@ -54,6 +57,11 @@ def main():
|
|
|
54
57
|
logging.basicConfig(level=logging.INFO)
|
|
55
58
|
logging.info('Debug logging enabled')
|
|
56
59
|
|
|
60
|
+
# Change directory, if specified
|
|
61
|
+
|
|
62
|
+
if args.path:
|
|
63
|
+
os.chdir(args.path[0])
|
|
64
|
+
|
|
57
65
|
# 'Add' implies 'all'
|
|
58
66
|
|
|
59
67
|
if args.everything:
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
"""
|
|
10
10
|
################################################################################
|
|
11
11
|
|
|
12
|
+
import os
|
|
12
13
|
import sys
|
|
13
14
|
import argparse
|
|
14
15
|
import logging
|
|
15
16
|
|
|
17
|
+
# TODO: Update to git2
|
|
16
18
|
import thingy.git as git
|
|
17
19
|
import thingy.colour as colour
|
|
18
20
|
|
|
@@ -38,6 +40,8 @@ def parse_command_line():
|
|
|
38
40
|
parser.add_argument('--unmerged', '-u', action='store_true', dest='list_unmerged', help='List branches that have NOT been merged')
|
|
39
41
|
parser.add_argument('--yes', '-y', action='store_true', dest='force', help='Assume "yes" in response to any prompts (e.g. to delete branches)')
|
|
40
42
|
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')
|
|
41
45
|
|
|
42
46
|
parser.add_argument('branches', nargs='*', help='List of branches to check (default is all branches)')
|
|
43
47
|
|
|
@@ -94,6 +98,11 @@ def main():
|
|
|
94
98
|
if args.debug:
|
|
95
99
|
logging.basicConfig(level=logging.INFO)
|
|
96
100
|
|
|
101
|
+
# Change directory, if specified
|
|
102
|
+
|
|
103
|
+
if args.path:
|
|
104
|
+
os.chdir(args.path[0])
|
|
105
|
+
|
|
97
106
|
# Get the list of all local branches
|
|
98
107
|
|
|
99
108
|
try:
|
|
@@ -280,6 +289,8 @@ def git_cleanup():
|
|
|
280
289
|
sys.exit(1)
|
|
281
290
|
except BrokenPipeError:
|
|
282
291
|
sys.exit(2)
|
|
292
|
+
except git.GitError as exc:
|
|
293
|
+
colour.error(exc.msg, status=exc.status, prefix=True)
|
|
283
294
|
|
|
284
295
|
################################################################################
|
|
285
296
|
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"""
|
|
21
21
|
################################################################################
|
|
22
22
|
|
|
23
|
+
import os
|
|
23
24
|
import logging
|
|
24
25
|
import sys
|
|
25
26
|
import argparse
|
|
@@ -68,6 +69,8 @@ def parse_arguments():
|
|
|
68
69
|
parser.add_argument('--debug', action='store_true', help='Enable debug output')
|
|
69
70
|
parser.add_argument('branchname', nargs=1, type=str,
|
|
70
71
|
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')
|
|
71
74
|
|
|
72
75
|
args = parser.parse_args()
|
|
73
76
|
|
|
@@ -76,6 +79,9 @@ def parse_arguments():
|
|
|
76
79
|
if args.debug:
|
|
77
80
|
logging.basicConfig(level=logging.INFO)
|
|
78
81
|
|
|
82
|
+
if args.path:
|
|
83
|
+
os.chdir(args.path[0])
|
|
84
|
+
|
|
79
85
|
return args
|
|
80
86
|
|
|
81
87
|
################################################################################
|
|
@@ -198,9 +204,6 @@ def main():
|
|
|
198
204
|
else:
|
|
199
205
|
checkout_matching_branch(args, args.branchname[0])
|
|
200
206
|
|
|
201
|
-
except git.GitError as exc:
|
|
202
|
-
colour.error(exc.msg, exc.status)
|
|
203
|
-
|
|
204
207
|
################################################################################
|
|
205
208
|
|
|
206
209
|
def git_co():
|
|
@@ -213,6 +216,8 @@ def git_co():
|
|
|
213
216
|
sys.exit(1)
|
|
214
217
|
except BrokenPipeError:
|
|
215
218
|
sys.exit(2)
|
|
219
|
+
except git.GitError as exc:
|
|
220
|
+
colour.error(exc.msg, status=exc.status, prefix=True)
|
|
216
221
|
|
|
217
222
|
################################################################################
|
|
218
223
|
|
|
@@ -6,10 +6,12 @@ Report the oldest commit in common in the history of two commits
|
|
|
6
6
|
|
|
7
7
|
################################################################################
|
|
8
8
|
|
|
9
|
+
import os
|
|
9
10
|
import sys
|
|
10
11
|
import argparse
|
|
11
12
|
|
|
12
13
|
import thingy.colour as colour
|
|
14
|
+
# TODO: Update to git2
|
|
13
15
|
import thingy.git as git
|
|
14
16
|
|
|
15
17
|
################################################################################
|
|
@@ -21,6 +23,8 @@ def main():
|
|
|
21
23
|
|
|
22
24
|
parser.add_argument('--short', '-s', action='store_true', help='Just output the ancestor commit ID')
|
|
23
25
|
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')
|
|
24
28
|
parser.add_argument('commit1', nargs='?', default='HEAD', help='First commit (default=HEAD)')
|
|
25
29
|
parser.add_argument('commit2', nargs='?', default='master', help='Second commit (default=master)')
|
|
26
30
|
|
|
@@ -29,10 +33,12 @@ def main():
|
|
|
29
33
|
if args.long and args.short:
|
|
30
34
|
colour.error('The [BLUE:--long] and [BLUE:--short] options cannot be used together', prefix=True)
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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)
|
|
36
42
|
|
|
37
43
|
if args.short:
|
|
38
44
|
print(ancestor)
|
|
@@ -54,6 +60,8 @@ def git_common():
|
|
|
54
60
|
sys.exit(1)
|
|
55
61
|
except BrokenPipeError:
|
|
56
62
|
sys.exit(2)
|
|
63
|
+
except git.GitError as exc:
|
|
64
|
+
colour.error(exc.msg, status=exc.status, prefix=True)
|
|
57
65
|
|
|
58
66
|
################################################################################
|
|
59
67
|
|
|
@@ -2,11 +2,13 @@
|
|
|
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
|
|
5
6
|
import sys
|
|
6
7
|
import argparse
|
|
7
8
|
import fnmatch
|
|
8
9
|
|
|
9
10
|
import thingy.colour as colour
|
|
11
|
+
# TODO: Update to git2
|
|
10
12
|
import thingy.git as git
|
|
11
13
|
|
|
12
14
|
################################################################################
|
|
@@ -118,6 +120,8 @@ def main():
|
|
|
118
120
|
parser = argparse.ArgumentParser(description='Archive, list or recover one or more Git branches')
|
|
119
121
|
parser.add_argument('--list', '-l', action='store_true', help='List archived branches')
|
|
120
122
|
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')
|
|
121
125
|
parser.add_argument('branches', nargs='*', help='Branches')
|
|
122
126
|
|
|
123
127
|
args = parser.parse_args()
|
|
@@ -128,6 +132,9 @@ def main():
|
|
|
128
132
|
if not args.branches and not args.list:
|
|
129
133
|
colour.error('No branches specified', prefix=True)
|
|
130
134
|
|
|
135
|
+
if args.path:
|
|
136
|
+
os.chdir(args.path[0])
|
|
137
|
+
|
|
131
138
|
if args.list:
|
|
132
139
|
list_archive_branches(args.branches)
|
|
133
140
|
elif args.restore:
|
|
@@ -147,6 +154,8 @@ def git_hold():
|
|
|
147
154
|
sys.exit(1)
|
|
148
155
|
except BrokenPipeError:
|
|
149
156
|
sys.exit(2)
|
|
157
|
+
except git.GitError as exc:
|
|
158
|
+
colour.error(exc.msg, status=exc.status, prefix=True)
|
|
150
159
|
|
|
151
160
|
################################################################################
|
|
152
161
|
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
""" Push to Gitlab and create a merge request at the same time """
|
|
5
5
|
################################################################################
|
|
6
6
|
|
|
7
|
+
import os
|
|
7
8
|
import logging
|
|
8
9
|
import sys
|
|
9
10
|
import argparse
|
|
10
11
|
|
|
12
|
+
# TODO: Update to git2
|
|
11
13
|
import thingy.git as git
|
|
12
14
|
import thingy.colour as colour
|
|
13
15
|
|
|
@@ -27,6 +29,8 @@ def parse_arguments():
|
|
|
27
29
|
parser.add_argument('--parent', '-p', action='store', help='Override the default parent and specify the branch to merge onto')
|
|
28
30
|
parser.add_argument('--reviewer', '-r', action='store', help='Specify the name of the reviewer for the merge request')
|
|
29
31
|
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')
|
|
30
34
|
|
|
31
35
|
args = parser.parse_args()
|
|
32
36
|
|
|
@@ -35,6 +39,11 @@ def parse_arguments():
|
|
|
35
39
|
if args.debug:
|
|
36
40
|
logging.basicConfig(level=logging.INFO)
|
|
37
41
|
|
|
42
|
+
# Change directory, if specified
|
|
43
|
+
|
|
44
|
+
if args.path:
|
|
45
|
+
os.chdir(args.path[0])
|
|
46
|
+
|
|
38
47
|
return args
|
|
39
48
|
|
|
40
49
|
################################################################################
|
|
@@ -86,6 +95,8 @@ def git_mr():
|
|
|
86
95
|
sys.exit(1)
|
|
87
96
|
except BrokenPipeError:
|
|
88
97
|
sys.exit(2)
|
|
98
|
+
except git.GitError as exc:
|
|
99
|
+
colour.error(exc.msg, status=exc.status, prefix=True)
|
|
89
100
|
|
|
90
101
|
################################################################################
|
|
91
102
|
|
|
@@ -7,9 +7,11 @@ 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
|
|
10
11
|
import argparse
|
|
11
12
|
import sys
|
|
12
13
|
|
|
14
|
+
# TODO: Update to git2
|
|
13
15
|
import thingy.git as git
|
|
14
16
|
import thingy.colour as colour
|
|
15
17
|
|
|
@@ -23,33 +25,34 @@ def main():
|
|
|
23
25
|
parser = argparse.ArgumentParser(description='Attempt to determine the parent branch for the specified branch (defaulting to the current one)')
|
|
24
26
|
parser.add_argument('--all', '-a', action='store_true', help='Include feature branches as possible parents')
|
|
25
27
|
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')
|
|
26
30
|
parser.add_argument('branch', action='store', nargs='?', type=str, default=current_branch,
|
|
27
31
|
help=f'Branch, commit or commit (defaults to current branch; {current_branch})')
|
|
28
32
|
|
|
29
33
|
args = parser.parse_args()
|
|
30
34
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
any_parents, any_distance = git.parents(args.branch)
|
|
34
|
-
else:
|
|
35
|
-
any_parents = []
|
|
35
|
+
if args.path:
|
|
36
|
+
os.chdir(args.path[0])
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
if args.all:
|
|
39
|
+
any_parents, any_distance = git.parents(args.branch)
|
|
40
|
+
else:
|
|
41
|
+
any_parents = []
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
# (one or both) based on distance.
|
|
43
|
+
parents, distance = git.parents(args.branch, ignore='feature/*')
|
|
41
44
|
|
|
42
|
-
|
|
43
|
-
|
|
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)
|
|
45
|
+
# If we have feature and non-feature branch candidates, decide which to report
|
|
46
|
+
# (one or both) based on distance.
|
|
50
47
|
|
|
51
|
-
|
|
52
|
-
|
|
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)
|
|
53
56
|
|
|
54
57
|
if parents:
|
|
55
58
|
if args.verbose:
|
|
@@ -73,6 +76,8 @@ def git_parent():
|
|
|
73
76
|
sys.exit(1)
|
|
74
77
|
except BrokenPipeError:
|
|
75
78
|
sys.exit(2)
|
|
79
|
+
except git.GitError as exc:
|
|
80
|
+
colour.error(exc.msg, status=exc.status, prefix=True)
|
|
76
81
|
|
|
77
82
|
################################################################################
|
|
78
83
|
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"""
|
|
10
10
|
################################################################################
|
|
11
11
|
|
|
12
|
+
import os
|
|
12
13
|
import sys
|
|
13
14
|
import argparse
|
|
14
15
|
|
|
@@ -23,10 +24,17 @@ def main():
|
|
|
23
24
|
|
|
24
25
|
parser = argparse.ArgumentParser(description='Apply or update a tag, optionally updating it on the remote as well.')
|
|
25
26
|
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')
|
|
26
29
|
parser.add_argument('tag', nargs=1, help='The tag')
|
|
27
30
|
|
|
28
31
|
args = parser.parse_args()
|
|
29
32
|
|
|
33
|
+
# Change directory, if specified
|
|
34
|
+
|
|
35
|
+
if args.path:
|
|
36
|
+
os.chdir(args.path[0])
|
|
37
|
+
|
|
30
38
|
tag = args.tag[0]
|
|
31
39
|
|
|
32
40
|
# Delete the tag if it currently exists, optionally pushing the deletion
|
|
@@ -49,6 +57,8 @@ def git_retag():
|
|
|
49
57
|
sys.exit(1)
|
|
50
58
|
except BrokenPipeError:
|
|
51
59
|
sys.exit(2)
|
|
60
|
+
except git.GitError as exc:
|
|
61
|
+
colour.error(exc.msg, status=exc.status, prefix=True)
|
|
52
62
|
|
|
53
63
|
################################################################################
|
|
54
64
|
|
|
@@ -14,6 +14,7 @@ import sys
|
|
|
14
14
|
import logging
|
|
15
15
|
import argparse
|
|
16
16
|
import re
|
|
17
|
+
import datetime
|
|
17
18
|
|
|
18
19
|
from enum import Enum
|
|
19
20
|
|
|
@@ -126,15 +127,24 @@ def media_sync(args):
|
|
|
126
127
|
continue
|
|
127
128
|
|
|
128
129
|
date_match = filetype_re.fullmatch(os.path.basename(sourcefile))
|
|
129
|
-
if
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
if date_match:
|
|
131
|
+
year = date_match.group(2)
|
|
132
|
+
month = date_match.group(3)
|
|
133
|
+
day = date_match.group(4)
|
|
134
|
+
|
|
135
|
+
default_dest_dir = f'{dest_dir}/{year}/{year}-{month}-{day}'
|
|
136
|
+
else:
|
|
137
|
+
logging.debug('Ignoring %s - unable to extract date from filename - using last-modified date', sourcefile)
|
|
138
|
+
|
|
139
|
+
timestamp = os.path.getmtime(sourcefile)
|
|
140
|
+
last_modified_date = datetime.datetime.fromtimestamp(timestamp)
|
|
141
|
+
|
|
142
|
+
year = last_modified_date.year
|
|
143
|
+
month = last_modified_date.month
|
|
144
|
+
day = last_modified_date.day
|
|
132
145
|
|
|
133
|
-
|
|
134
|
-
month = date_match.group(3)
|
|
135
|
-
day = date_match.group(4)
|
|
146
|
+
default_dest_dir = f'{dest_dir}/{year:04}/{year:04}-{month:02}-{day:02}'
|
|
136
147
|
|
|
137
|
-
default_dest_dir = f'{dest_dir}/{year}/{year}-{month}-{day}'
|
|
138
148
|
dest_dir_pattern = f'{default_dest_dir}*'
|
|
139
149
|
|
|
140
150
|
dest_dirs = [path for path in glob.glob(dest_dir_pattern) if os.path.isdir(path)]
|
|
@@ -34,7 +34,11 @@ import thingy.gitlab as gitlab
|
|
|
34
34
|
################################################################################
|
|
35
35
|
# Configuration files to access
|
|
36
36
|
|
|
37
|
-
(LOCAL, GLOBAL, SYSTEM) = list(range(
|
|
37
|
+
(WORKTREE, LOCAL, GLOBAL, SYSTEM) = list(range(4))
|
|
38
|
+
|
|
39
|
+
# Default default branches (can be overridden in .gitconfig via skilleter-thingy.defaultBranches
|
|
40
|
+
|
|
41
|
+
DEFAULT_DEFAULT_BRANCHES = 'develop,main,master'
|
|
38
42
|
|
|
39
43
|
################################################################################
|
|
40
44
|
|
|
@@ -814,7 +818,7 @@ def reset(sha1):
|
|
|
814
818
|
|
|
815
819
|
################################################################################
|
|
816
820
|
|
|
817
|
-
def config_get(section, key, source=
|
|
821
|
+
def config_get(section, key, source=None, defaultvalue=None):
|
|
818
822
|
""" Return the specified configuration entry
|
|
819
823
|
Returns a default value if no matching configuration entry exists """
|
|
820
824
|
|
|
@@ -824,6 +828,10 @@ def config_get(section, key, source=LOCAL, defaultvalue=None):
|
|
|
824
828
|
cmd.append('--global')
|
|
825
829
|
elif source == SYSTEM:
|
|
826
830
|
cmd.append('--system')
|
|
831
|
+
elif source == LOCAL:
|
|
832
|
+
cmd.append('--local')
|
|
833
|
+
elif source == WORKTREE:
|
|
834
|
+
cmd.append('--worktree')
|
|
827
835
|
|
|
828
836
|
cmd += ['--get', f'{section}.{key}']
|
|
829
837
|
|
|
@@ -834,7 +842,7 @@ def config_get(section, key, source=LOCAL, defaultvalue=None):
|
|
|
834
842
|
|
|
835
843
|
################################################################################
|
|
836
844
|
|
|
837
|
-
def config_set(section, key, value, source=
|
|
845
|
+
def config_set(section, key, value, source=None):
|
|
838
846
|
""" Set a configuration entry """
|
|
839
847
|
|
|
840
848
|
cmd = ['config']
|
|
@@ -843,6 +851,10 @@ def config_set(section, key, value, source=LOCAL):
|
|
|
843
851
|
cmd.append('--global')
|
|
844
852
|
elif source == SYSTEM:
|
|
845
853
|
cmd.append('--system')
|
|
854
|
+
elif source == LOCAL:
|
|
855
|
+
cmd.append('--local')
|
|
856
|
+
elif source == WORKTREE:
|
|
857
|
+
cmd.append('--worktree')
|
|
846
858
|
|
|
847
859
|
cmd += ['--replace-all', f'{section}.{key}', value]
|
|
848
860
|
|
|
@@ -1172,12 +1184,13 @@ def default_branch():
|
|
|
1172
1184
|
return None
|
|
1173
1185
|
|
|
1174
1186
|
git_branches = branches()
|
|
1187
|
+
default_branches = config_get('skilleter-thingy', 'defaultBranches', defaultvalue=DEFAULT_DEFAULT_BRANCHES).split(',')
|
|
1175
1188
|
|
|
1176
|
-
for branch in
|
|
1189
|
+
for branch in default_branches:
|
|
1177
1190
|
if branch in git_branches:
|
|
1178
1191
|
return branch
|
|
1179
1192
|
|
|
1180
|
-
|
|
1193
|
+
raise GitError('Unable to determine default branch in the repo')
|
|
1181
1194
|
|
|
1182
1195
|
################################################################################
|
|
1183
1196
|
|
|
@@ -36,13 +36,17 @@ import thingy.gitlab as gitlab
|
|
|
36
36
|
################################################################################
|
|
37
37
|
# Configuration files to access
|
|
38
38
|
|
|
39
|
-
(LOCAL, GLOBAL, SYSTEM) = list(range(
|
|
39
|
+
(WORKTREE, LOCAL, GLOBAL, SYSTEM) = list(range(4))
|
|
40
40
|
|
|
41
41
|
# Options always passed to Git (disable autocorrect to stop it running the wrong command
|
|
42
42
|
# if an invalid command name has been specified).
|
|
43
43
|
|
|
44
44
|
STANDARD_GIT_OPTIONS = ['-c', 'help.autoCorrect=never']
|
|
45
45
|
|
|
46
|
+
# Default default branches (can be overridden in .gitconfig via skilleter-thingy.defaultBranches
|
|
47
|
+
|
|
48
|
+
DEFAULT_DEFAULT_BRANCHES = 'develop,main,master'
|
|
49
|
+
|
|
46
50
|
################################################################################
|
|
47
51
|
|
|
48
52
|
class GitError(run.RunError):
|
|
@@ -74,7 +78,7 @@ def git(cmd, stdout=None, stderr=None, path=None):
|
|
|
74
78
|
try:
|
|
75
79
|
return run.run(git_cmd, stdout=stdout, stderr=stderr)
|
|
76
80
|
except run.RunError as exc:
|
|
77
|
-
raise GitError(exc.msg, exc.status)
|
|
81
|
+
raise GitError(exc.msg, exc.status) from exc
|
|
78
82
|
|
|
79
83
|
################################################################################
|
|
80
84
|
|
|
@@ -103,7 +107,7 @@ def git_run_status(cmd, stdout=None, stderr=None, path=None, redirect=True):
|
|
|
103
107
|
errors='ignore',
|
|
104
108
|
universal_newlines=True)
|
|
105
109
|
else:
|
|
106
|
-
result = subprocess.run(git_cmd)
|
|
110
|
+
result = subprocess.run(git_cmd, check=False)
|
|
107
111
|
|
|
108
112
|
return (result.stdout or result.stderr), result.returncode
|
|
109
113
|
|
|
@@ -775,7 +779,7 @@ def reset(sha1, path=None):
|
|
|
775
779
|
|
|
776
780
|
################################################################################
|
|
777
781
|
|
|
778
|
-
def config_get(section, key, source=
|
|
782
|
+
def config_get(section, key, source=None, defaultvalue=None, path=None):
|
|
779
783
|
""" Return the specified configuration entry
|
|
780
784
|
Returns a default value if no matching configuration entry exists """
|
|
781
785
|
|
|
@@ -785,6 +789,10 @@ def config_get(section, key, source=LOCAL, defaultvalue=None, path=None):
|
|
|
785
789
|
cmd.append('--global')
|
|
786
790
|
elif source == SYSTEM:
|
|
787
791
|
cmd.append('--system')
|
|
792
|
+
elif source == LOCAL:
|
|
793
|
+
cmd.append('--local')
|
|
794
|
+
elif source == WORKTREE:
|
|
795
|
+
cmd.append('--worktree')
|
|
788
796
|
|
|
789
797
|
cmd += ['--get', f'{section}.{key}']
|
|
790
798
|
|
|
@@ -795,7 +803,7 @@ def config_get(section, key, source=LOCAL, defaultvalue=None, path=None):
|
|
|
795
803
|
|
|
796
804
|
################################################################################
|
|
797
805
|
|
|
798
|
-
def config_set(section, key, value, source=
|
|
806
|
+
def config_set(section, key, value, source=None, path=None):
|
|
799
807
|
""" Set a configuration entry """
|
|
800
808
|
|
|
801
809
|
cmd = ['config']
|
|
@@ -804,6 +812,10 @@ def config_set(section, key, value, source=LOCAL, path=None):
|
|
|
804
812
|
cmd.append('--global')
|
|
805
813
|
elif source == SYSTEM:
|
|
806
814
|
cmd.append('--system')
|
|
815
|
+
elif source == LOCAL:
|
|
816
|
+
cmd.append('--local')
|
|
817
|
+
elif source == WORKTREE:
|
|
818
|
+
cmd.append('--worktree')
|
|
807
819
|
|
|
808
820
|
cmd += ['--replace-all', f'{section}.{key}', value]
|
|
809
821
|
|
|
@@ -1130,12 +1142,13 @@ def default_branch(path=None):
|
|
|
1130
1142
|
return None
|
|
1131
1143
|
|
|
1132
1144
|
git_branches = branches(path=path)
|
|
1145
|
+
default_branches = config_get('skilleter-thingy', 'defaultBranches', defaultvalue=DEFAULT_DEFAULT_BRANCHES).split(',')
|
|
1133
1146
|
|
|
1134
|
-
for branch in
|
|
1147
|
+
for branch in default_branches:
|
|
1135
1148
|
if branch in git_branches:
|
|
1136
1149
|
return branch
|
|
1137
1150
|
|
|
1138
|
-
|
|
1151
|
+
raise GitError('Unable to determine default branch in the repo')
|
|
1139
1152
|
|
|
1140
1153
|
################################################################################
|
|
1141
1154
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: skilleter_thingy
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.31
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
{skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy/thingy/venv_template.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{skilleter_thingy-0.1.29 → skilleter_thingy-0.1.31}/skilleter_thingy.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|