skilleter-thingy 0.2.14__tar.gz → 0.3.0__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.2.14 → skilleter_thingy-0.3.0}/PKG-INFO +77 -56
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/README.md +76 -55
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/pyproject.toml +1 -8
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/docker_purge.py +1 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/gitcmp_helper.py +2 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/multigit.py +6 -4
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/py_audit.py +5 -4
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/docker.py +19 -11
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/git.py +11 -5
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy.egg-info/PKG-INFO +77 -56
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy.egg-info/SOURCES.txt +0 -4
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy.egg-info/entry_points.txt +0 -7
- skilleter_thingy-0.2.14/skilleter_thingy/git_mr.py +0 -103
- skilleter_thingy-0.2.14/skilleter_thingy/gl.py +0 -174
- skilleter_thingy-0.2.14/skilleter_thingy/rmdupe.py +0 -553
- skilleter_thingy-0.2.14/skilleter_thingy/x.py +0 -3
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/LICENSE +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/setup.cfg +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/__init__.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/addpath.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/console_colours.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/ffind.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/ggit.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/ggrep.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/git_br.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/git_ca.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/git_cleanup.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/git_co.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/git_common.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/git_hold.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/git_parent.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/git_retag.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/git_review.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/git_update.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/git_wt.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/gitprompt.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/linecount.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/readable.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/remdir.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/rpylint.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/strreplace.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/tfm.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/tfparse.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/__init__.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/colour.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/dc_curses.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/dc_defaults.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/dc_util.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/dircolors.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/files.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/gitlab.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/path.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/popup.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/run.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/tfm_pane.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/tidy.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/thingy/venv_template.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/trimpath.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/venv_create.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/xchmod.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy/yamlcheck.py +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy.egg-info/dependency_links.txt +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/skilleter_thingy.egg-info/requires.txt +0 -0
- {skilleter_thingy-0.2.14 → skilleter_thingy-0.3.0}/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.
|
|
3
|
+
Version: 0.3.0
|
|
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
|
|
@@ -52,7 +52,7 @@ For ease of use it is recommended that you create an alias for multigit called `
|
|
|
52
52
|
|
|
53
53
|
alias mg="multigit $@"
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
### Initialisation
|
|
56
56
|
|
|
57
57
|
To use multigit, start by creating working trees for the repositories that you want to use in a directory tree - the working trees can be at different levels or even nested, for example:
|
|
58
58
|
|
|
@@ -70,7 +70,7 @@ To use multigit, start by creating working trees for the repositories that you w
|
|
|
70
70
|
|
|
71
71
|
Start by running ensuring that the default branch (e.g. `main`) is checked out in each of the working trees and, in the top-level directory, run `multigit init` to create the configuration file which, by default is called `multigit.toml` - this is just a text file that sets the configuration for each working tree in terms of name, origin, default branch, tags and location.
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
### Multigit Command Line
|
|
74
74
|
|
|
75
75
|
The multigit command line format is:
|
|
76
76
|
|
|
@@ -100,7 +100,7 @@ These options are AND-ed together, so specifying `--modified --branched --tag WO
|
|
|
100
100
|
|
|
101
101
|
Multigit tags are stored in the configuration file, not within the working tree and each working tree can have multiple tags.
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
### Multigit Commands
|
|
104
104
|
|
|
105
105
|
Multigit supports a small list of subcommands, each of which are prefixed with a `+` to distinguish them from Git commands:
|
|
106
106
|
|
|
@@ -184,6 +184,21 @@ This is most useful where branches contain ticket numbers so, for instance given
|
|
|
184
184
|
|
|
185
185
|
Note that the concept of the default branch `DEFAULT` mentioned above *only* applies when using the `multigit` command, although some of the commands will treat branches called `master` or `main` as special cases (see the individual command documentation).
|
|
186
186
|
|
|
187
|
+
## git br
|
|
188
|
+
|
|
189
|
+
List or delete branches that have been merged
|
|
190
|
+
|
|
191
|
+
usage: git-br [-h] [--all] [--delete] [--path PATH] [branches ...]
|
|
192
|
+
|
|
193
|
+
positional arguments:
|
|
194
|
+
branches Filter the list of branches according to one or more patterns
|
|
195
|
+
|
|
196
|
+
options:
|
|
197
|
+
-h, --help show this help message and exit
|
|
198
|
+
--all, -a List all branches, including remotes
|
|
199
|
+
--delete, -d Delete the specified branch(es), even if it is the current one (list of branches to delete must be supplied as parameters)
|
|
200
|
+
--path PATH, -C PATH Run the command in the specified directory
|
|
201
|
+
|
|
187
202
|
## git ca
|
|
188
203
|
|
|
189
204
|
Improved version of 'git commit --amend'. Updates files that are already in the commit and, optionally, adds and commits additional files.
|
|
@@ -242,6 +257,37 @@ Equivalent to `git checkout` but with enhanced branch matching as described abov
|
|
|
242
257
|
--exact, -e Do not use branch name matching - check out the branch as specified (if it exists)
|
|
243
258
|
--debug Enable debug output
|
|
244
259
|
|
|
260
|
+
## git common
|
|
261
|
+
|
|
262
|
+
Find the most recent common ancestor for two commits
|
|
263
|
+
|
|
264
|
+
usage: git-common [-h] [--short] [--long] [--path PATH] [commit1] [commit2]
|
|
265
|
+
|
|
266
|
+
positional arguments:
|
|
267
|
+
commit1 First commit (default=HEAD)
|
|
268
|
+
commit2 Second commit (default=master)
|
|
269
|
+
|
|
270
|
+
options:
|
|
271
|
+
-h, --help show this help message and exit
|
|
272
|
+
--short, -s Just output the ancestor commit ID
|
|
273
|
+
--long, -l Output the log entry for the commit
|
|
274
|
+
--path PATH, -C PATH Run the command in the specified directory
|
|
275
|
+
|
|
276
|
+
## git hold
|
|
277
|
+
|
|
278
|
+
Archive, list or recover one or more Git branches
|
|
279
|
+
|
|
280
|
+
usage: git-hold [-h] [--list] [--restore] [--path PATH] [branches ...]
|
|
281
|
+
|
|
282
|
+
positional arguments:
|
|
283
|
+
branches Branches
|
|
284
|
+
|
|
285
|
+
options:
|
|
286
|
+
-h, --help show this help message and exit
|
|
287
|
+
--list, -l List archived branches
|
|
288
|
+
--restore, -r Restore archived branches
|
|
289
|
+
--path PATH, -C PATH Run the command in the specified directory
|
|
290
|
+
|
|
245
291
|
## git parent
|
|
246
292
|
|
|
247
293
|
Attempt to determine the parent branch for the specified branch (defaulting to the current one).
|
|
@@ -258,6 +304,21 @@ Attempt to determine the parent branch for the specified branch (defaulting to t
|
|
|
258
304
|
--all, -a Include feature branches as possible parents
|
|
259
305
|
--verbose, -v Report verbose results (includes number of commits between branch and parent)
|
|
260
306
|
|
|
307
|
+
## git retag
|
|
308
|
+
|
|
309
|
+
Apply or update a tag, optionally updating it on the remote as well. If the specified tag exists, it is deleted
|
|
310
|
+
and re-applied, otherwise it is recreated.
|
|
311
|
+
|
|
312
|
+
usage: git-retag [-h] [--push] [--path PATH] tag
|
|
313
|
+
|
|
314
|
+
positional arguments:
|
|
315
|
+
tag The tag
|
|
316
|
+
|
|
317
|
+
options:
|
|
318
|
+
-h, --help show this help message and exit
|
|
319
|
+
--push, -p Push the tag to the remote
|
|
320
|
+
--path PATH, -C PATH Run the command in the specified directory
|
|
321
|
+
|
|
261
322
|
## git update
|
|
262
323
|
|
|
263
324
|
Update the rworking tree from the remote, rebase local branch(es) against their parents and optionally run git cleanup.
|
|
@@ -313,6 +374,14 @@ Menu-driven Git code review tool
|
|
|
313
374
|
--dir DIR Work in the specified directory
|
|
314
375
|
--difftool DIFFTOOL Override the default git diff tool
|
|
315
376
|
|
|
377
|
+
## ggit
|
|
378
|
+
|
|
379
|
+
Run a git command in all working trees under the current directory (somewhat superceded by multigit).
|
|
380
|
+
|
|
381
|
+
## ggrep
|
|
382
|
+
|
|
383
|
+
Run 'git grep' in all repos under the current directory (somewhat superceded by multigit).
|
|
384
|
+
|
|
316
385
|
# General Commands
|
|
317
386
|
|
|
318
387
|
## addpath
|
|
@@ -334,6 +403,10 @@ Add or remove entries from a path list (e.g. as used by the PATH environment var
|
|
|
334
403
|
--separator SEPARATOR
|
|
335
404
|
Override the default path separator
|
|
336
405
|
|
|
406
|
+
## consolecolours
|
|
407
|
+
|
|
408
|
+
Display all available colours in the console.
|
|
409
|
+
|
|
337
410
|
## docker-purge
|
|
338
411
|
|
|
339
412
|
Stop or kill docker instances and/or remove docker images.
|
|
@@ -470,24 +543,6 @@ Recursively delete empty directories
|
|
|
470
543
|
Files to ignore when considering whether a directory is empty
|
|
471
544
|
--keep KEEP, -K KEEP Directories that should be kept even if they are empty
|
|
472
545
|
|
|
473
|
-
## rmdupe
|
|
474
|
-
|
|
475
|
-
Search for duplicate files.
|
|
476
|
-
|
|
477
|
-
rmdupe [-h] [--debug] [--save SAVE] [--load LOAD] [--script SCRIPT] [--exclude EXCLUDE] [--ignore IGNORE] [path]
|
|
478
|
-
|
|
479
|
-
positional arguments:
|
|
480
|
-
path Path(s) to search for duplicates
|
|
481
|
-
|
|
482
|
-
options:
|
|
483
|
-
-h, --help show this help message and exit
|
|
484
|
-
--debug Debug output
|
|
485
|
-
--save SAVE Save duplicate file list
|
|
486
|
-
--load LOAD Load duplicate file list
|
|
487
|
-
--script SCRIPT Generate a shell script to delete the duplicates
|
|
488
|
-
--exclude EXCLUDE Directories to skip when looking for duplicates
|
|
489
|
-
--ignore IGNORE Wildcards to ignore when looking for duplicates
|
|
490
|
-
|
|
491
546
|
## rpylint
|
|
492
547
|
|
|
493
548
|
Run pylint on all the Python source files in a directory tree
|
|
@@ -500,10 +555,6 @@ Run pylint on all the Python source files in a directory tree
|
|
|
500
555
|
options:
|
|
501
556
|
-h, --help show this help message and exit
|
|
502
557
|
|
|
503
|
-
## s3-sync
|
|
504
|
-
|
|
505
|
-
Synchronise files from S3 to local storage.
|
|
506
|
-
|
|
507
558
|
## strreplace
|
|
508
559
|
|
|
509
560
|
Simple search and replace utility for those times when trying to escape characters in a regexp to use sed is more hassle than it is worth.
|
|
@@ -592,33 +643,3 @@ YAML validator - checks that a file is valid YAML (use yamllint to verify that i
|
|
|
592
643
|
--block Force block style when dumping the YAML data
|
|
593
644
|
--flow Force flow style when dumping the YAML data
|
|
594
645
|
--hiera Process the file as Puppet Hiera data
|
|
595
|
-
|
|
596
|
-
# Obsolescent Utilities
|
|
597
|
-
|
|
598
|
-
These will be moved to the skilleter-extras package in due course.
|
|
599
|
-
|
|
600
|
-
## consolecolours
|
|
601
|
-
|
|
602
|
-
Display all available colours in the console.
|
|
603
|
-
|
|
604
|
-
# Obsolescent Commands
|
|
605
|
-
|
|
606
|
-
These commands will probably be retired in future versions of Thingy
|
|
607
|
-
|
|
608
|
-
## ggit
|
|
609
|
-
|
|
610
|
-
Run a git command in all working trees under the current directory (superceded by multigit).
|
|
611
|
-
|
|
612
|
-
## ggrep
|
|
613
|
-
|
|
614
|
-
Run 'git grep' in all repos under the current directory (superceded by multigit).
|
|
615
|
-
|
|
616
|
-
## GitLab Commands
|
|
617
|
-
|
|
618
|
-
### git mr
|
|
619
|
-
|
|
620
|
-
Push a feature branch to GitLab and create a merge request
|
|
621
|
-
|
|
622
|
-
### gl
|
|
623
|
-
|
|
624
|
-
Command line for GitLab
|
|
@@ -29,7 +29,7 @@ For ease of use it is recommended that you create an alias for multigit called `
|
|
|
29
29
|
|
|
30
30
|
alias mg="multigit $@"
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
### Initialisation
|
|
33
33
|
|
|
34
34
|
To use multigit, start by creating working trees for the repositories that you want to use in a directory tree - the working trees can be at different levels or even nested, for example:
|
|
35
35
|
|
|
@@ -47,7 +47,7 @@ To use multigit, start by creating working trees for the repositories that you w
|
|
|
47
47
|
|
|
48
48
|
Start by running ensuring that the default branch (e.g. `main`) is checked out in each of the working trees and, in the top-level directory, run `multigit init` to create the configuration file which, by default is called `multigit.toml` - this is just a text file that sets the configuration for each working tree in terms of name, origin, default branch, tags and location.
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
### Multigit Command Line
|
|
51
51
|
|
|
52
52
|
The multigit command line format is:
|
|
53
53
|
|
|
@@ -77,7 +77,7 @@ These options are AND-ed together, so specifying `--modified --branched --tag WO
|
|
|
77
77
|
|
|
78
78
|
Multigit tags are stored in the configuration file, not within the working tree and each working tree can have multiple tags.
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
### Multigit Commands
|
|
81
81
|
|
|
82
82
|
Multigit supports a small list of subcommands, each of which are prefixed with a `+` to distinguish them from Git commands:
|
|
83
83
|
|
|
@@ -161,6 +161,21 @@ This is most useful where branches contain ticket numbers so, for instance given
|
|
|
161
161
|
|
|
162
162
|
Note that the concept of the default branch `DEFAULT` mentioned above *only* applies when using the `multigit` command, although some of the commands will treat branches called `master` or `main` as special cases (see the individual command documentation).
|
|
163
163
|
|
|
164
|
+
## git br
|
|
165
|
+
|
|
166
|
+
List or delete branches that have been merged
|
|
167
|
+
|
|
168
|
+
usage: git-br [-h] [--all] [--delete] [--path PATH] [branches ...]
|
|
169
|
+
|
|
170
|
+
positional arguments:
|
|
171
|
+
branches Filter the list of branches according to one or more patterns
|
|
172
|
+
|
|
173
|
+
options:
|
|
174
|
+
-h, --help show this help message and exit
|
|
175
|
+
--all, -a List all branches, including remotes
|
|
176
|
+
--delete, -d Delete the specified branch(es), even if it is the current one (list of branches to delete must be supplied as parameters)
|
|
177
|
+
--path PATH, -C PATH Run the command in the specified directory
|
|
178
|
+
|
|
164
179
|
## git ca
|
|
165
180
|
|
|
166
181
|
Improved version of 'git commit --amend'. Updates files that are already in the commit and, optionally, adds and commits additional files.
|
|
@@ -219,6 +234,37 @@ Equivalent to `git checkout` but with enhanced branch matching as described abov
|
|
|
219
234
|
--exact, -e Do not use branch name matching - check out the branch as specified (if it exists)
|
|
220
235
|
--debug Enable debug output
|
|
221
236
|
|
|
237
|
+
## git common
|
|
238
|
+
|
|
239
|
+
Find the most recent common ancestor for two commits
|
|
240
|
+
|
|
241
|
+
usage: git-common [-h] [--short] [--long] [--path PATH] [commit1] [commit2]
|
|
242
|
+
|
|
243
|
+
positional arguments:
|
|
244
|
+
commit1 First commit (default=HEAD)
|
|
245
|
+
commit2 Second commit (default=master)
|
|
246
|
+
|
|
247
|
+
options:
|
|
248
|
+
-h, --help show this help message and exit
|
|
249
|
+
--short, -s Just output the ancestor commit ID
|
|
250
|
+
--long, -l Output the log entry for the commit
|
|
251
|
+
--path PATH, -C PATH Run the command in the specified directory
|
|
252
|
+
|
|
253
|
+
## git hold
|
|
254
|
+
|
|
255
|
+
Archive, list or recover one or more Git branches
|
|
256
|
+
|
|
257
|
+
usage: git-hold [-h] [--list] [--restore] [--path PATH] [branches ...]
|
|
258
|
+
|
|
259
|
+
positional arguments:
|
|
260
|
+
branches Branches
|
|
261
|
+
|
|
262
|
+
options:
|
|
263
|
+
-h, --help show this help message and exit
|
|
264
|
+
--list, -l List archived branches
|
|
265
|
+
--restore, -r Restore archived branches
|
|
266
|
+
--path PATH, -C PATH Run the command in the specified directory
|
|
267
|
+
|
|
222
268
|
## git parent
|
|
223
269
|
|
|
224
270
|
Attempt to determine the parent branch for the specified branch (defaulting to the current one).
|
|
@@ -235,6 +281,21 @@ Attempt to determine the parent branch for the specified branch (defaulting to t
|
|
|
235
281
|
--all, -a Include feature branches as possible parents
|
|
236
282
|
--verbose, -v Report verbose results (includes number of commits between branch and parent)
|
|
237
283
|
|
|
284
|
+
## git retag
|
|
285
|
+
|
|
286
|
+
Apply or update a tag, optionally updating it on the remote as well. If the specified tag exists, it is deleted
|
|
287
|
+
and re-applied, otherwise it is recreated.
|
|
288
|
+
|
|
289
|
+
usage: git-retag [-h] [--push] [--path PATH] tag
|
|
290
|
+
|
|
291
|
+
positional arguments:
|
|
292
|
+
tag The tag
|
|
293
|
+
|
|
294
|
+
options:
|
|
295
|
+
-h, --help show this help message and exit
|
|
296
|
+
--push, -p Push the tag to the remote
|
|
297
|
+
--path PATH, -C PATH Run the command in the specified directory
|
|
298
|
+
|
|
238
299
|
## git update
|
|
239
300
|
|
|
240
301
|
Update the rworking tree from the remote, rebase local branch(es) against their parents and optionally run git cleanup.
|
|
@@ -290,6 +351,14 @@ Menu-driven Git code review tool
|
|
|
290
351
|
--dir DIR Work in the specified directory
|
|
291
352
|
--difftool DIFFTOOL Override the default git diff tool
|
|
292
353
|
|
|
354
|
+
## ggit
|
|
355
|
+
|
|
356
|
+
Run a git command in all working trees under the current directory (somewhat superceded by multigit).
|
|
357
|
+
|
|
358
|
+
## ggrep
|
|
359
|
+
|
|
360
|
+
Run 'git grep' in all repos under the current directory (somewhat superceded by multigit).
|
|
361
|
+
|
|
293
362
|
# General Commands
|
|
294
363
|
|
|
295
364
|
## addpath
|
|
@@ -311,6 +380,10 @@ Add or remove entries from a path list (e.g. as used by the PATH environment var
|
|
|
311
380
|
--separator SEPARATOR
|
|
312
381
|
Override the default path separator
|
|
313
382
|
|
|
383
|
+
## consolecolours
|
|
384
|
+
|
|
385
|
+
Display all available colours in the console.
|
|
386
|
+
|
|
314
387
|
## docker-purge
|
|
315
388
|
|
|
316
389
|
Stop or kill docker instances and/or remove docker images.
|
|
@@ -447,24 +520,6 @@ Recursively delete empty directories
|
|
|
447
520
|
Files to ignore when considering whether a directory is empty
|
|
448
521
|
--keep KEEP, -K KEEP Directories that should be kept even if they are empty
|
|
449
522
|
|
|
450
|
-
## rmdupe
|
|
451
|
-
|
|
452
|
-
Search for duplicate files.
|
|
453
|
-
|
|
454
|
-
rmdupe [-h] [--debug] [--save SAVE] [--load LOAD] [--script SCRIPT] [--exclude EXCLUDE] [--ignore IGNORE] [path]
|
|
455
|
-
|
|
456
|
-
positional arguments:
|
|
457
|
-
path Path(s) to search for duplicates
|
|
458
|
-
|
|
459
|
-
options:
|
|
460
|
-
-h, --help show this help message and exit
|
|
461
|
-
--debug Debug output
|
|
462
|
-
--save SAVE Save duplicate file list
|
|
463
|
-
--load LOAD Load duplicate file list
|
|
464
|
-
--script SCRIPT Generate a shell script to delete the duplicates
|
|
465
|
-
--exclude EXCLUDE Directories to skip when looking for duplicates
|
|
466
|
-
--ignore IGNORE Wildcards to ignore when looking for duplicates
|
|
467
|
-
|
|
468
523
|
## rpylint
|
|
469
524
|
|
|
470
525
|
Run pylint on all the Python source files in a directory tree
|
|
@@ -477,10 +532,6 @@ Run pylint on all the Python source files in a directory tree
|
|
|
477
532
|
options:
|
|
478
533
|
-h, --help show this help message and exit
|
|
479
534
|
|
|
480
|
-
## s3-sync
|
|
481
|
-
|
|
482
|
-
Synchronise files from S3 to local storage.
|
|
483
|
-
|
|
484
535
|
## strreplace
|
|
485
536
|
|
|
486
537
|
Simple search and replace utility for those times when trying to escape characters in a regexp to use sed is more hassle than it is worth.
|
|
@@ -569,33 +620,3 @@ YAML validator - checks that a file is valid YAML (use yamllint to verify that i
|
|
|
569
620
|
--block Force block style when dumping the YAML data
|
|
570
621
|
--flow Force flow style when dumping the YAML data
|
|
571
622
|
--hiera Process the file as Puppet Hiera data
|
|
572
|
-
|
|
573
|
-
# Obsolescent Utilities
|
|
574
|
-
|
|
575
|
-
These will be moved to the skilleter-extras package in due course.
|
|
576
|
-
|
|
577
|
-
## consolecolours
|
|
578
|
-
|
|
579
|
-
Display all available colours in the console.
|
|
580
|
-
|
|
581
|
-
# Obsolescent Commands
|
|
582
|
-
|
|
583
|
-
These commands will probably be retired in future versions of Thingy
|
|
584
|
-
|
|
585
|
-
## ggit
|
|
586
|
-
|
|
587
|
-
Run a git command in all working trees under the current directory (superceded by multigit).
|
|
588
|
-
|
|
589
|
-
## ggrep
|
|
590
|
-
|
|
591
|
-
Run 'git grep' in all repos under the current directory (superceded by multigit).
|
|
592
|
-
|
|
593
|
-
## GitLab Commands
|
|
594
|
-
|
|
595
|
-
### git mr
|
|
596
|
-
|
|
597
|
-
Push a feature branch to GitLab and create a merge request
|
|
598
|
-
|
|
599
|
-
### gl
|
|
600
|
-
|
|
601
|
-
Command line for GitLab
|
|
@@ -7,7 +7,7 @@ name = "skilleter_thingy"
|
|
|
7
7
|
|
|
8
8
|
# Version must be incremented to install updated Thingy
|
|
9
9
|
|
|
10
|
-
version = "0.
|
|
10
|
+
version = "0.3.0"
|
|
11
11
|
|
|
12
12
|
authors = [
|
|
13
13
|
{name="John Skilleter", email="john@skilleter.org.uk"},
|
|
@@ -53,7 +53,6 @@ git-cleanup = "skilleter_thingy:git_cleanup.git_cleanup"
|
|
|
53
53
|
git-co = "skilleter_thingy:git_co.git_co"
|
|
54
54
|
git-common = "skilleter_thingy:git_common.git_common"
|
|
55
55
|
git-hold = "skilleter_thingy:git_hold.git_hold"
|
|
56
|
-
git-mr = "skilleter_thingy:git_mr.git_mr"
|
|
57
56
|
git-parent = "skilleter_thingy:git_parent.git_parent"
|
|
58
57
|
git-retag = "skilleter_thingy:git_retag.git_retag"
|
|
59
58
|
git-review = "skilleter_thingy:git_review.git_review"
|
|
@@ -61,22 +60,16 @@ git-update = "skilleter_thingy:git_update.git_update"
|
|
|
61
60
|
git-wt = "skilleter_thingy:git_wt.git_wt"
|
|
62
61
|
gitcmp-helper = "skilleter_thingy:gitcmp_helper.gitcmp_helper"
|
|
63
62
|
gitprompt = "skilleter_thingy:gitprompt.gitprompt"
|
|
64
|
-
gl = "skilleter_thingy:gl.gl"
|
|
65
|
-
gphotosync = "skilleter_thingy:gphotosync.gphotosync"
|
|
66
63
|
linecount = "skilleter_thingy:linecount.linecount"
|
|
67
|
-
mg = "skilleter_thingy:mg.mg"
|
|
68
64
|
multigit = "skilleter_thingy:multigit.multigit"
|
|
69
65
|
py-audit = "skilleter_thingy:py_audit.py_audit"
|
|
70
66
|
readable = "skilleter_thingy:readable.readable"
|
|
71
67
|
remdir = "skilleter_thingy:remdir.remdir"
|
|
72
|
-
rmdupe = "skilleter_thingy:rmdupe.rmdupe"
|
|
73
68
|
rpylint = "skilleter_thingy:rpylint.rpylint"
|
|
74
|
-
s3-sync = "skilleter_thingy:s3_sync.s3_sync"
|
|
75
69
|
strreplace = "skilleter_thingy:strreplace.strreplace"
|
|
76
70
|
tfm = "skilleter_thingy:tfm.tfm"
|
|
77
71
|
tfparse = "skilleter_thingy:tfparse.tfparse"
|
|
78
72
|
trimpath = "skilleter_thingy:trimpath.trimpath"
|
|
79
73
|
venv-create = "skilleter_thingy:venv_create.venv_create"
|
|
80
|
-
webwatch = "skilleter_thingy:webwatch.webwatch"
|
|
81
74
|
xchmod = "skilleter_thingy:xchmod.xchmod"
|
|
82
75
|
yamlcheck = "skilleter_thingy:yamlcheck.yamlcheck"
|
|
@@ -21,6 +21,7 @@ from thingy import docker
|
|
|
21
21
|
def initialise():
|
|
22
22
|
""" Parse the command line """
|
|
23
23
|
|
|
24
|
+
breakpoint()
|
|
24
25
|
parser = argparse.ArgumentParser(description='Purge docker instances and images')
|
|
25
26
|
|
|
26
27
|
parser.add_argument('--stop', '-s', action='store_true', help='Stop Docker instances')
|
|
@@ -298,8 +298,10 @@ def main():
|
|
|
298
298
|
if not deleted_file or not skip_deleted:
|
|
299
299
|
try:
|
|
300
300
|
subprocess.run([difftool, args.old_file, args.new_file], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=True)
|
|
301
|
+
|
|
301
302
|
except subprocess.CalledProcessError as exc:
|
|
302
303
|
print(f'WARNING: Diff failed - status = {exc.returncode}')
|
|
304
|
+
|
|
303
305
|
except FileNotFoundError:
|
|
304
306
|
print(f'ERROR: Unable to locate diff tool {difftool}')
|
|
305
307
|
sys.exit(1)
|
|
@@ -646,16 +646,18 @@ def mg_run(args, config, console):
|
|
|
646
646
|
repo_path = absolute_repo_path(args, repo.name)
|
|
647
647
|
|
|
648
648
|
try:
|
|
649
|
-
status = subprocess.run(args.parameters, cwd=repo_path, check=
|
|
649
|
+
status = subprocess.run(args.parameters, cwd=repo_path, check=True)
|
|
650
|
+
|
|
650
651
|
except FileNotFoundError:
|
|
651
652
|
err_msg = f'"[BLUE:{args.parameters[0]}]" - Command not found'
|
|
652
653
|
if args.error_continue:
|
|
653
654
|
colour.write(f'[RED:WARNING]: {err_msg}')
|
|
654
655
|
else:
|
|
655
656
|
colour.error(f'[RED:ERROR]: {err_msg}')
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
657
|
+
|
|
658
|
+
except subprocess.CalledProcessError as exc:
|
|
659
|
+
if not args.error_continue:
|
|
660
|
+
sys.exit(exc.returncode)
|
|
659
661
|
|
|
660
662
|
################################################################################
|
|
661
663
|
|
|
@@ -100,11 +100,12 @@ def main():
|
|
|
100
100
|
f' && python3 -m pip {PIP_OPTIONS} list | tail -n+3 | tee {package_list.name}' \
|
|
101
101
|
' && deactivate'
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
try:
|
|
104
|
+
subprocess.run(script, check=True, shell=True)
|
|
104
105
|
|
|
105
|
-
|
|
106
|
-
print(f'ERROR #{
|
|
107
|
-
sys.exit(
|
|
106
|
+
except subprocess.CalledProcessError as exc:
|
|
107
|
+
print(f'ERROR #{exc.returncode}: {exc.stdout}')
|
|
108
|
+
sys.exit(exc.returncode)
|
|
108
109
|
|
|
109
110
|
with open(package_list.name) as infile:
|
|
110
111
|
for package in infile.readlines():
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"""
|
|
13
13
|
################################################################################
|
|
14
14
|
|
|
15
|
-
import
|
|
15
|
+
import subprocess
|
|
16
16
|
|
|
17
17
|
################################################################################
|
|
18
18
|
|
|
@@ -33,9 +33,12 @@ def instances(all=False):
|
|
|
33
33
|
|
|
34
34
|
instances_list = []
|
|
35
35
|
try:
|
|
36
|
-
|
|
36
|
+
process = subprocess.run(cmd, capture_output=True, check=True, text=True)
|
|
37
|
+
|
|
38
|
+
for result in process.stdout:
|
|
37
39
|
instances_list.append(result)
|
|
38
|
-
|
|
40
|
+
|
|
41
|
+
except subprocess.CalledProcessError as exc:
|
|
39
42
|
raise DockerError(exc)
|
|
40
43
|
|
|
41
44
|
return instances_list
|
|
@@ -48,8 +51,9 @@ def stop(instance, force=False):
|
|
|
48
51
|
# TODO: force option not implemented
|
|
49
52
|
|
|
50
53
|
try:
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
subprocess.run(['docker', 'stop', instance], check=True, capture_output=False)
|
|
55
|
+
|
|
56
|
+
except suprocess.CalledProcessError as exc:
|
|
53
57
|
raise DockerError(exc)
|
|
54
58
|
|
|
55
59
|
################################################################################
|
|
@@ -65,8 +69,9 @@ def rm(instance, force=False):
|
|
|
65
69
|
cmd.append(instance)
|
|
66
70
|
|
|
67
71
|
try:
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
subprocess.run(cmd, check=True, capture_output=False)
|
|
73
|
+
|
|
74
|
+
except subprocess.CalledProcessError as exc:
|
|
70
75
|
raise DockerError(exc)
|
|
71
76
|
|
|
72
77
|
################################################################################
|
|
@@ -75,9 +80,12 @@ def images():
|
|
|
75
80
|
""" Return a list of all current Docker images """
|
|
76
81
|
|
|
77
82
|
try:
|
|
78
|
-
|
|
83
|
+
process = subprocess.run(['docker', 'images', '-q'], capture_output=True, check=True)
|
|
84
|
+
|
|
85
|
+
for result in process:
|
|
79
86
|
yield result
|
|
80
|
-
|
|
87
|
+
|
|
88
|
+
except subprocess.CalledProcessError as exc:
|
|
81
89
|
raise DockerError(exc)
|
|
82
90
|
|
|
83
91
|
################################################################################
|
|
@@ -92,6 +100,6 @@ def rmi(image, force=False):
|
|
|
92
100
|
cmd.append(image)
|
|
93
101
|
|
|
94
102
|
try:
|
|
95
|
-
|
|
96
|
-
except
|
|
103
|
+
subprocess.run(cmd, capture_output=False, check=True)
|
|
104
|
+
except subprocess.CalledProcessError as exc:
|
|
97
105
|
raise DockerError(exc)
|
|
@@ -85,7 +85,7 @@ def git(cmd, stdout=None, stderr=None, path=None):
|
|
|
85
85
|
################################################################################
|
|
86
86
|
|
|
87
87
|
def git_run_status(cmd, stdout=None, stderr=None, path=None, redirect=True):
|
|
88
|
-
""" Wrapper for
|
|
88
|
+
""" Wrapper for subprocess.run that returns the output and status, and
|
|
89
89
|
does not raise an exception on error.
|
|
90
90
|
Optionally redirect stdout and stderr as specified. """
|
|
91
91
|
|
|
@@ -948,7 +948,7 @@ def ref(fields=('objectname'), sort=None, remotes=False, path=None):
|
|
|
948
948
|
|
|
949
949
|
################################################################################
|
|
950
950
|
|
|
951
|
-
def branches(all=False, path=None):
|
|
951
|
+
def branches(all=False, path=None, remote=False):
|
|
952
952
|
""" Return a list of all the branches in the current repo """
|
|
953
953
|
|
|
954
954
|
cmd = ['branch', '--format=%(refname:short)','--list']
|
|
@@ -956,6 +956,9 @@ def branches(all=False, path=None):
|
|
|
956
956
|
if all:
|
|
957
957
|
cmd.append('--all')
|
|
958
958
|
|
|
959
|
+
if remote:
|
|
960
|
+
cmd.append('--remote')
|
|
961
|
+
|
|
959
962
|
results = []
|
|
960
963
|
for output in git(cmd, path=path):
|
|
961
964
|
if ' -> ' not in output and '(HEAD detached at ' not in output:
|
|
@@ -1250,7 +1253,10 @@ def matching_branch(branchname, case=False, path=None):
|
|
|
1250
1253
|
otherwise, it just checks for a branches containing the branchname
|
|
1251
1254
|
as a substring. """
|
|
1252
1255
|
|
|
1253
|
-
|
|
1256
|
+
local_branches = branches(path=path)
|
|
1257
|
+
remote_branches = branches(path=path, remote=True)
|
|
1258
|
+
|
|
1259
|
+
all_branches = local_branches + remote_branches
|
|
1254
1260
|
|
|
1255
1261
|
# Always return exact matches
|
|
1256
1262
|
|
|
@@ -1284,8 +1290,8 @@ def matching_branch(branchname, case=False, path=None):
|
|
|
1284
1290
|
# If the match is a remote branch, ignore it if we already have the equivalent
|
|
1285
1291
|
# local branch, otherwise add the name of the local branch that would be created.
|
|
1286
1292
|
|
|
1287
|
-
if branch
|
|
1288
|
-
localbranch = '/'.join(branch.split('/')[
|
|
1293
|
+
if branch in remote_branches:
|
|
1294
|
+
localbranch = '/'.join(branch.split('/')[1:])
|
|
1289
1295
|
if localbranch not in matching:
|
|
1290
1296
|
matching_remote.append(localbranch)
|
|
1291
1297
|
else:
|