mud-git 1.0.2__tar.gz → 1.0.4__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.
- {mud_git-1.0.2 → mud_git-1.0.4}/.github/workflows/publish.yaml +1 -1
- {mud_git-1.0.2 → mud_git-1.0.4}/PKG-INFO +35 -7
- mud_git-1.0.4/PKGBUILD +23 -0
- {mud_git-1.0.2 → mud_git-1.0.4}/README.md +6 -0
- {mud_git-1.0.2 → mud_git-1.0.4}/pyproject.toml +12 -10
- mud_git-1.0.4/setup.cfg +4 -0
- {mud_git-1.0.2 → mud_git-1.0.4}/src/mud/app.py +2 -6
- {mud_git-1.0.2 → mud_git-1.0.4}/src/mud/commands.py +1 -2
- {mud_git-1.0.2 → mud_git-1.0.4}/src/mud/runner.py +9 -8
- {mud_git-1.0.2 → mud_git-1.0.4}/src/mud/styles.py +1 -0
- {mud_git-1.0.2 → mud_git-1.0.4}/src/mud/utils.py +17 -31
- mud_git-1.0.4/src/mud_git.egg-info/PKG-INFO +138 -0
- mud_git-1.0.4/src/mud_git.egg-info/SOURCES.txt +23 -0
- mud_git-1.0.4/src/mud_git.egg-info/dependency_links.txt +1 -0
- mud_git-1.0.4/src/mud_git.egg-info/entry_points.txt +2 -0
- mud_git-1.0.4/src/mud_git.egg-info/requires.txt +1 -0
- mud_git-1.0.4/src/mud_git.egg-info/top_level.txt +1 -0
- mud_git-1.0.2/src/mud/__about__.py +0 -1
- {mud_git-1.0.2 → mud_git-1.0.4}/.github/workflows/test.yaml +0 -0
- {mud_git-1.0.2 → mud_git-1.0.4}/.gitignore +0 -0
- {mud_git-1.0.2 → mud_git-1.0.4}/LICENSE +0 -0
- {mud_git-1.0.2 → mud_git-1.0.4}/img.png +0 -0
- {mud_git-1.0.2 → mud_git-1.0.4}/requirements.txt +0 -0
- {mud_git-1.0.2 → mud_git-1.0.4}/src/mud/__init__.py +0 -0
- {mud_git-1.0.2 → mud_git-1.0.4}/src/mud/config.py +0 -0
- {mud_git-1.0.2 → mud_git-1.0.4}/src/mud/settings.py +0 -0
|
@@ -1,21 +1,44 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: mud-git
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 1.0.4
|
|
4
|
+
Summary: Multi repository git utility. Manage multiple git-repositories simultaneously.
|
|
5
|
+
Author-email: Jasur Sadikov <jasur@sadikoff.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2024 Jasur Sadikov
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
5
28
|
Project-URL: Homepage, https://github.com/jasursadikov/mud
|
|
6
29
|
Project-URL: Issues, https://github.com/jasursadikov/mud/issues
|
|
7
|
-
|
|
8
|
-
License-File: LICENSE
|
|
30
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
31
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
32
|
Classifier: Operating System :: OS Independent
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
33
|
Requires-Python: >=3.12
|
|
13
|
-
Requires-Dist: prettytable
|
|
14
34
|
Description-Content-Type: text/markdown
|
|
35
|
+
License-File: LICENSE
|
|
36
|
+
Requires-Dist: prettytable
|
|
15
37
|
|
|
16
38
|
# mud
|
|
17
39
|
|
|
18
40
|

|
|
41
|
+

|
|
19
42
|

|
|
20
43
|

|
|
21
44
|
|
|
@@ -24,9 +47,14 @@ Description-Content-Type: text/markdown
|
|
|
24
47
|
mud is a multi-directory git runner which allows you to run git commands in a multiple repositories. It has multiple powerful tools filtering tools and support of aliasing. This tool is not limited to git commands only, you can run any commands as you wish, but this tool was primarily designed to be used with git, so each referenced directory should have `.git`.
|
|
25
48
|
|
|
26
49
|
## Installing
|
|
50
|
+
For PyPI
|
|
27
51
|
```bash
|
|
28
52
|
pip install mud-git
|
|
29
53
|
```
|
|
54
|
+
For Arch Linux
|
|
55
|
+
```bash
|
|
56
|
+
paru -S mud-git
|
|
57
|
+
```
|
|
30
58
|
|
|
31
59
|
## Getting started
|
|
32
60
|
|
mud_git-1.0.4/PKGBUILD
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Maintainer: Jasur Sadikov <jasur@sadikoff.com>
|
|
2
|
+
pkgname=mud-git
|
|
3
|
+
pkgver=1.0.3
|
|
4
|
+
pkgrel=1
|
|
5
|
+
pkgdesc="Multi repository git utility. Manage multiple git-repositories simultaneously."
|
|
6
|
+
arch=('any')
|
|
7
|
+
url="https://github.com/jasursadikov/mud"
|
|
8
|
+
license=('MIT')
|
|
9
|
+
depends=('python' 'python-prettytable')
|
|
10
|
+
makedepends=('python-build' 'python-setuptools' 'python-setuptools-scm' 'git')
|
|
11
|
+
source=("${pkgname}::git+https://github.com/jasursadikov/mud.git")
|
|
12
|
+
md5sums=('SKIP')
|
|
13
|
+
|
|
14
|
+
build() {
|
|
15
|
+
cd "$srcdir/$pkgname"
|
|
16
|
+
python -m build --wheel --no-isolation
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
package() {
|
|
20
|
+
cd "$srcdir/$pkgname"
|
|
21
|
+
python -m installer --destdir="$pkgdir" dist/*.whl
|
|
22
|
+
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
|
23
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# mud
|
|
2
2
|
|
|
3
3
|

|
|
4
|
+

|
|
4
5
|

|
|
5
6
|

|
|
6
7
|
|
|
@@ -9,9 +10,14 @@
|
|
|
9
10
|
mud is a multi-directory git runner which allows you to run git commands in a multiple repositories. It has multiple powerful tools filtering tools and support of aliasing. This tool is not limited to git commands only, you can run any commands as you wish, but this tool was primarily designed to be used with git, so each referenced directory should have `.git`.
|
|
10
11
|
|
|
11
12
|
## Installing
|
|
13
|
+
For PyPI
|
|
12
14
|
```bash
|
|
13
15
|
pip install mud-git
|
|
14
16
|
```
|
|
17
|
+
For Arch Linux
|
|
18
|
+
```bash
|
|
19
|
+
paru -S mud-git
|
|
20
|
+
```
|
|
15
21
|
|
|
16
22
|
## Getting started
|
|
17
23
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["hatchling"]
|
|
3
|
-
build-backend = "
|
|
2
|
+
requires = ["hatchling", "setuptools-scm"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "mud-git"
|
|
7
|
-
|
|
7
|
+
dynamic = ["version"]
|
|
8
8
|
authors = [{ name = "Jasur Sadikov", email = "jasur@sadikoff.com" }]
|
|
9
|
-
description = "
|
|
9
|
+
description = "Multi repository git utility. Manage multiple git-repositories simultaneously."
|
|
10
10
|
readme = "README.md"
|
|
11
|
+
license = { file = "LICENSE" }
|
|
11
12
|
requires-python = ">=3.12"
|
|
12
13
|
classifiers = [
|
|
13
14
|
"Programming Language :: Python :: 3",
|
|
@@ -16,15 +17,16 @@ classifiers = [
|
|
|
16
17
|
]
|
|
17
18
|
dependencies = ["prettytable"]
|
|
18
19
|
|
|
19
|
-
[
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
[tool.setuptools_scm]
|
|
21
|
+
version_scheme = "no-guess-dev"
|
|
22
|
+
local_scheme = "no-local-version"
|
|
22
23
|
|
|
23
24
|
[tool.hatch.build.targets.wheel]
|
|
24
25
|
packages = ["src/mud"]
|
|
25
26
|
|
|
26
|
-
[tool.hatch.version]
|
|
27
|
-
path = "src/mud/__about__.py"
|
|
28
|
-
|
|
29
27
|
[project.scripts]
|
|
30
28
|
mud = "mud:run"
|
|
29
|
+
|
|
30
|
+
[project.urls]
|
|
31
|
+
Homepage = "https://github.com/jasursadikov/mud"
|
|
32
|
+
Issues = "https://github.com/jasursadikov/mud/issues"
|
mud_git-1.0.4/setup.cfg
ADDED
|
@@ -54,14 +54,14 @@ class App:
|
|
|
54
54
|
parser.add_argument(*DIVERGED_ATTR, action='store_true', help='Filters repositories with diverged branches.')
|
|
55
55
|
parser.add_argument(*ASYNC_ATTR, action='store_true', help='Switches asynchronous run feature.')
|
|
56
56
|
parser.add_argument(SET_GLOBAL[0], help=f'Sets {BOLD}.mudconfig{RESET} in the current repository as your fallback {BOLD}.mudconfig{RESET}.', action='store_true')
|
|
57
|
-
parser.add_argument(VERSION[0], help='Displays the current version of mud.', action='store_true')
|
|
58
57
|
parser.add_argument('catch_all', nargs='*', help='Type any commands to execute among repositories.')
|
|
59
58
|
return parser
|
|
60
59
|
|
|
61
60
|
def run(self) -> None:
|
|
62
61
|
# Displays default help message
|
|
63
62
|
if len(sys.argv) == 1 or sys.argv[1] in HELP:
|
|
64
|
-
utils.
|
|
63
|
+
utils.info()
|
|
64
|
+
print()
|
|
65
65
|
self.parser.print_help()
|
|
66
66
|
return
|
|
67
67
|
# Sets global repository in .mudsettings
|
|
@@ -72,10 +72,6 @@ class App:
|
|
|
72
72
|
utils.settings.save()
|
|
73
73
|
print(f'Current {BOLD}.mudconfig{RESET} set as a global configuration.')
|
|
74
74
|
return
|
|
75
|
-
# Prints version
|
|
76
|
-
elif sys.argv[1] in VERSION:
|
|
77
|
-
utils.version()
|
|
78
|
-
return
|
|
79
75
|
# Runs configuration wizard
|
|
80
76
|
elif sys.argv[1] in CONFIGURE:
|
|
81
77
|
utils.configure()
|
|
@@ -10,11 +10,10 @@ STATUS = ['status', 'st']
|
|
|
10
10
|
BRANCHES = ['branch', 'branches', 'br']
|
|
11
11
|
REMOTE_BRANCHES = ['remote-branch', 'remote-branches', 'rbr']
|
|
12
12
|
HELP = ['help', '--help', '-h']
|
|
13
|
-
VERSION = ['--version', '-v', 'version']
|
|
14
13
|
CONFIGURE = ['configure', 'config']
|
|
15
14
|
SET_GLOBAL = ['--set-global']
|
|
16
15
|
|
|
17
|
-
COMMANDS = [ADD, REMOVE, LOG, INFO, INIT, TAGS, LABELS, STATUS, BRANCHES, REMOTE_BRANCHES, HELP,
|
|
16
|
+
COMMANDS = [ADD, REMOVE, LOG, INFO, INIT, TAGS, LABELS, STATUS, BRANCHES, REMOTE_BRANCHES, HELP, CONFIGURE, SET_GLOBAL]
|
|
18
17
|
|
|
19
18
|
# Filters
|
|
20
19
|
ASYNC_ATTR = '-a', '--async'
|
|
@@ -11,7 +11,8 @@ from mud.styles import *
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class Runner:
|
|
14
|
-
|
|
14
|
+
_force_color_env = {"GIT_PAGER": "cat", "TERM": "xterm-256color", "GIT_CONFIG_PARAMETERS": "'color.ui=always'"}
|
|
15
|
+
_label_color_cache = {}
|
|
15
16
|
_current_color_index = 0
|
|
16
17
|
|
|
17
18
|
def __init__(self, repos):
|
|
@@ -231,7 +232,7 @@ class Runner:
|
|
|
231
232
|
# `mud <COMMAND>` when run_async = 0 and run_table = 0
|
|
232
233
|
def run_ordered(self, repos: List[str], command: str) -> None:
|
|
233
234
|
for path in repos:
|
|
234
|
-
process = subprocess.run(command, cwd=path, universal_newlines=True, shell=True, capture_output=True, text=True)
|
|
235
|
+
process = subprocess.run(command, cwd=path, universal_newlines=True, shell=True, capture_output=True, text=True, env=self._force_color_env)
|
|
235
236
|
self._print_process_header(path, command, process.returncode != 0, process.returncode)
|
|
236
237
|
if process.stdout and not process.stdout.isspace():
|
|
237
238
|
print(process.stdout)
|
|
@@ -244,7 +245,7 @@ class Runner:
|
|
|
244
245
|
|
|
245
246
|
async def run_process(path: str) -> None:
|
|
246
247
|
async with sem:
|
|
247
|
-
process = await asyncio.create_subprocess_shell(command, cwd=path, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
248
|
+
process = await asyncio.create_subprocess_shell(command, cwd=path, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=self._force_color_env)
|
|
248
249
|
stdout, stderr = await process.communicate()
|
|
249
250
|
self._print_process_header(path, command, process.returncode != 0, process.returncode)
|
|
250
251
|
if stderr:
|
|
@@ -267,7 +268,7 @@ class Runner:
|
|
|
267
268
|
await asyncio.gather(*tasks)
|
|
268
269
|
|
|
269
270
|
async def _run_process(self, path: str, table: Dict[str, List[str]], command: str) -> None:
|
|
270
|
-
process = await asyncio.create_subprocess_shell(command, cwd=path, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
271
|
+
process = await asyncio.create_subprocess_shell(command, cwd=path, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=self._force_color_env)
|
|
271
272
|
table[path] = ['', f'{YELLOW}{glyphs("running")}{RESET}']
|
|
272
273
|
|
|
273
274
|
while True:
|
|
@@ -398,10 +399,10 @@ class Runner:
|
|
|
398
399
|
|
|
399
400
|
@staticmethod
|
|
400
401
|
def _print_process_header(path: str, command: str, failed: bool, code: int) -> None:
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
code = f'{
|
|
404
|
-
print(f'{
|
|
402
|
+
command = f'{BKG_WHITE}{BLACK}{glyphs("space")}{glyphs("terminal")}{glyphs("space")}{BOLD}{command} {END_BOLD}{WHITE}{RESET}{WHITE}{BKG_BLACK}{glyphs(")")}{RESET}'
|
|
403
|
+
path = f'{BKG_BLACK}{glyphs("space")}{DIM}{glyphs("directory")}{END_DIM}{glyphs("space")}{Runner._get_formatted_path(path)}{glyphs("space")}{RESET}'
|
|
404
|
+
code = f'{BLACK}{BKG_RED if failed else BKG_GREEN}{glyphs(")")}{BRIGHT_WHITE}{glyphs("space")}{glyphs("failed") if failed else glyphs("finished")} {f"{BOLD}{code}" if failed else ""}{glyphs("space")}{RESET}{RED if failed else GREEN}{glyphs(")")}{RESET}'
|
|
405
|
+
print(f'{command}{path}{code}')
|
|
405
406
|
|
|
406
407
|
@staticmethod
|
|
407
408
|
def _get_formatted_path(path: str, color: str = None) -> str:
|
|
@@ -8,7 +8,6 @@ from prettytable import PrettyTable, PLAIN_COLUMNS
|
|
|
8
8
|
|
|
9
9
|
from mud.settings import *
|
|
10
10
|
from mud.styles import *
|
|
11
|
-
from mud.__about__ import __version__
|
|
12
11
|
|
|
13
12
|
SETTINGS_FILE_NAME = '.mudsettings'
|
|
14
13
|
CONFIG_FILE_NAME = '.mudconfig'
|
|
@@ -20,25 +19,18 @@ def glyphs(key: str) -> str:
|
|
|
20
19
|
return GLYPHS[key][0 if settings.config['mud'].getboolean('nerd_fonts', fallback=False) else 1]
|
|
21
20
|
|
|
22
21
|
|
|
23
|
-
def
|
|
22
|
+
def info() -> None:
|
|
24
23
|
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
|
25
|
-
logo = get_logo()
|
|
26
|
-
info = f'Jasur Sadikov <jasur@sadikoff.com>\nhttps://github.com/jasursadikov/mud\n{BOLD}{random.choice(TEXT[3:])}{__version__}{RESET}'
|
|
27
|
-
print(logo)
|
|
28
|
-
print(info)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def get_logo() -> str:
|
|
32
24
|
colors = TEXT[3:]
|
|
33
25
|
colors.remove(BRIGHT_WHITE)
|
|
34
26
|
m = random.choice(colors)
|
|
35
27
|
u = random.choice(colors)
|
|
36
28
|
d = random.choice(colors)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
print(f' {d}__{RESET}')
|
|
30
|
+
print(f' {m}__ _ {u}__ __{d}___/ /{RESET}')
|
|
31
|
+
print(f' {m}/ \' \\{u}/ // / {d}_ /{RESET}')
|
|
32
|
+
print(f'{m}/_/_/_/{u}\\_,_/{d}\\_,_/ {RESET}')
|
|
33
|
+
print(f'Jasur Sadikov <jasur@sadikoff.com>\nhttps://github.com/jasursadikov/mud')
|
|
42
34
|
|
|
43
35
|
|
|
44
36
|
def configure() -> None:
|
|
@@ -56,23 +48,17 @@ def configure() -> None:
|
|
|
56
48
|
|
|
57
49
|
|
|
58
50
|
def ask(text: str) -> bool:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
response = sys.stdin.read(1).lower()
|
|
71
|
-
finally:
|
|
72
|
-
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
|
|
73
|
-
|
|
74
|
-
print()
|
|
75
|
-
return response in ['y', '\r', '\n']
|
|
51
|
+
try:
|
|
52
|
+
answer = input(f"{text}? [Y/n]: ").strip().lower()
|
|
53
|
+
if answer in ('y', 'yes', ''):
|
|
54
|
+
return True
|
|
55
|
+
elif answer in ('n', 'no'):
|
|
56
|
+
return False
|
|
57
|
+
else:
|
|
58
|
+
print("Invalid input.")
|
|
59
|
+
return True
|
|
60
|
+
except KeyboardInterrupt:
|
|
61
|
+
exit()
|
|
76
62
|
|
|
77
63
|
|
|
78
64
|
def print_table(table: PrettyTable) -> None:
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: mud-git
|
|
3
|
+
Version: 1.0.4
|
|
4
|
+
Summary: Multi repository git utility. Manage multiple git-repositories simultaneously.
|
|
5
|
+
Author-email: Jasur Sadikov <jasur@sadikoff.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2024 Jasur Sadikov
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/jasursadikov/mud
|
|
29
|
+
Project-URL: Issues, https://github.com/jasursadikov/mud/issues
|
|
30
|
+
Classifier: Programming Language :: Python :: 3
|
|
31
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
32
|
+
Classifier: Operating System :: OS Independent
|
|
33
|
+
Requires-Python: >=3.12
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
License-File: LICENSE
|
|
36
|
+
Requires-Dist: prettytable
|
|
37
|
+
|
|
38
|
+
# mud
|
|
39
|
+
|
|
40
|
+

|
|
41
|
+

|
|
42
|
+

|
|
43
|
+

|
|
44
|
+
|
|
45
|
+

|
|
46
|
+
|
|
47
|
+
mud is a multi-directory git runner which allows you to run git commands in a multiple repositories. It has multiple powerful tools filtering tools and support of aliasing. This tool is not limited to git commands only, you can run any commands as you wish, but this tool was primarily designed to be used with git, so each referenced directory should have `.git`.
|
|
48
|
+
|
|
49
|
+
## Installing
|
|
50
|
+
For PyPI
|
|
51
|
+
```bash
|
|
52
|
+
pip install mud-git
|
|
53
|
+
```
|
|
54
|
+
For Arch Linux
|
|
55
|
+
```bash
|
|
56
|
+
paru -S mud-git
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Getting started
|
|
60
|
+
|
|
61
|
+
1. Run `mud config` to start interactive wizard which help you to set the preferable settings. Check [settings](#settings) section for more. At the end, `.mudsettings` file will appear at your home directory that you can alter in the future.
|
|
62
|
+
2. Locate to your preferable directory with repositories.
|
|
63
|
+
3. Run `mud init` command to create `.mudconfig` file. This file is important to keep references to repositories. All repositories in current dictionary would be included to `.mudconfig`.
|
|
64
|
+
4. Optional: Run [`mud --set-global`](#global-mudconfig) to make current configuration default and reachable from any directory.
|
|
65
|
+
|
|
66
|
+
All entries are stored in `.mudconfig` in TSV format. After making your first entry, you can open `.mudconfig` in a text editor and modify it according to your needs.
|
|
67
|
+
|
|
68
|
+
### Global .mudconfig
|
|
69
|
+
- `mud --set-global` - sets current `.mudconfig` as a global configuration, so it would be used as a fallback configuration to run from any directory.
|
|
70
|
+
|
|
71
|
+
## Using
|
|
72
|
+
|
|
73
|
+
### Commands
|
|
74
|
+
`mud <FILTER> <COMMAND>` will execute bash command across all repositories. To filter repositories check [arguments](#arguments) section.
|
|
75
|
+
|
|
76
|
+
- `mud info`/`mud i` - displays branch divergence and working directory changes.
|
|
77
|
+
- `mud status`/`mud st` - displays working directory changes.
|
|
78
|
+
- `mud log`/`mud l` - displays latest commit message, it's time and it's author.
|
|
79
|
+
- `mud labels`/`mud lb` - displays mud labels across repositories.
|
|
80
|
+
- `mud branch`/`mud br` - displays all branches in repositories.
|
|
81
|
+
- `mud remote-branch`/`mud rbr` - displays all branches in repositories.
|
|
82
|
+
- `mud tags`/`mud t` - displays git tags in repositories.
|
|
83
|
+
|
|
84
|
+
### Arguments
|
|
85
|
+
- `-l=<label>` or `--label=<label>` - includes repositories with provided label.
|
|
86
|
+
- `-nl=<label>` or `--not-label=<label>` - excludes repositories with provided label.
|
|
87
|
+
- `-b=<branch>` or `--branch=<branch>` - includes repositories with provided branch.
|
|
88
|
+
- `-nb=<branch>` or `--not-branch=<branch>` - excludes repositories with provided label.
|
|
89
|
+
- `-c` or `--command` - explicit command argument. Use this whenever you're trying to run a complex command.
|
|
90
|
+
- `-m` or `--modified` - filters out modified repositories.
|
|
91
|
+
- `-d` or `--diverged` - filters repositories with diverged branches.
|
|
92
|
+
- `-t` or `--table` - toggles default table view setting for run.
|
|
93
|
+
- `-a` or `--async` - toggles asynchronous run feature.
|
|
94
|
+
|
|
95
|
+
Example:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
mud -b=master -d git pull
|
|
99
|
+
# Filters out all repos with master branch and diverged branches and then runs pull command.
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Settings
|
|
103
|
+
|
|
104
|
+
Settings are stored in your home directory in `.mudsettings` file.
|
|
105
|
+
|
|
106
|
+
- `run_async = 0/1` - enables asynchronous commands.
|
|
107
|
+
- `run_table = 0/1` - enables asynchronous commands in a table view. Requires `run_async`.
|
|
108
|
+
- `nerd_fonts = 0/1` - use nerd fonts in the output 💅.
|
|
109
|
+
- `show_borders = 0/1` - enables borders in table view.
|
|
110
|
+
- `collapse_paths = 0/1` - simplifies branch name in the branch view.
|
|
111
|
+
- `config_path = /home/user/path/.mudconfig` - this is set up by `mud --set-global` [command](#global-mudconfig).
|
|
112
|
+
|
|
113
|
+
### Aliases
|
|
114
|
+
|
|
115
|
+
You can create your own aliases for commands. To create your own aliases, edit .mudsettings file, `[alias]` section. .mudsettings has the following aliases by default:
|
|
116
|
+
|
|
117
|
+
```ini
|
|
118
|
+
[alias]
|
|
119
|
+
to = git checkout
|
|
120
|
+
fetch = git fetch
|
|
121
|
+
pull = git pull
|
|
122
|
+
push = git push
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Labeling
|
|
126
|
+
|
|
127
|
+
You can modify your .mudconfig file by using following commands:
|
|
128
|
+
|
|
129
|
+
### Adding and labeling repositories
|
|
130
|
+
|
|
131
|
+
- `mud add <label> <path>` - adds path with an optional label.
|
|
132
|
+
- `mud add <path>` - adds path without a label.
|
|
133
|
+
|
|
134
|
+
### Removing labels and repositories
|
|
135
|
+
|
|
136
|
+
- `mud remove <label>` - removes label from all directories.
|
|
137
|
+
- `mud remove <path>` - removes directory with a specified path.
|
|
138
|
+
- `mud remove <label> <path>` - removes label from a directory.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.gitignore
|
|
2
|
+
LICENSE
|
|
3
|
+
PKGBUILD
|
|
4
|
+
README.md
|
|
5
|
+
img.png
|
|
6
|
+
pyproject.toml
|
|
7
|
+
requirements.txt
|
|
8
|
+
.github/workflows/publish.yaml
|
|
9
|
+
.github/workflows/test.yaml
|
|
10
|
+
src/mud/__init__.py
|
|
11
|
+
src/mud/app.py
|
|
12
|
+
src/mud/commands.py
|
|
13
|
+
src/mud/config.py
|
|
14
|
+
src/mud/runner.py
|
|
15
|
+
src/mud/settings.py
|
|
16
|
+
src/mud/styles.py
|
|
17
|
+
src/mud/utils.py
|
|
18
|
+
src/mud_git.egg-info/PKG-INFO
|
|
19
|
+
src/mud_git.egg-info/SOURCES.txt
|
|
20
|
+
src/mud_git.egg-info/dependency_links.txt
|
|
21
|
+
src/mud_git.egg-info/entry_points.txt
|
|
22
|
+
src/mud_git.egg-info/requires.txt
|
|
23
|
+
src/mud_git.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
prettytable
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
mud
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.0.2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|