summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/nos.yml2
-rw-r--r--README.md2
-rw-r--r--gita/__main__.py19
-rw-r--r--setup.py2
4 files changed, 21 insertions, 4 deletions
diff --git a/.github/workflows/nos.yml b/.github/workflows/nos.yml
index e6c012b..9b81b05 100644
--- a/.github/workflows/nos.yml
+++ b/.github/workflows/nos.yml
@@ -23,3 +23,5 @@ jobs:
- name: Pytest
run: |
pytest tests --cov=./gita
+ - name: Upload coverage to Codecov
+ uses: codecov/codecov-action@v2
diff --git a/README.md b/README.md
index 06a0141..d54ec25 100644
--- a/README.md
+++ b/README.md
@@ -361,7 +361,7 @@ Thus the installed git version may matter.
I have git `1.8.3.1`, `2.17.2`, and `2.20.1` on my machines, and
their results agree.
-## tips
+## Tips
effect | shell command
---|---
diff --git a/gita/__main__.py b/gita/__main__.py
index d489f55..7e5e6bd 100644
--- a/gita/__main__.py
+++ b/gita/__main__.py
@@ -58,6 +58,7 @@ def _path_name(name: str) -> str:
def f_add(args: argparse.Namespace):
repos = utils.get_repos()
paths = args.paths
+ groups = utils.get_groups()
if 0:
# add to global and tag as main
main_repos = utils.add_repos(repos, paths, repo_type='m')
@@ -79,6 +80,13 @@ def f_add(args: argparse.Namespace):
if new_groups:
print(f'Created {len(new_groups)} new group(s).')
utils.write_to_groups_file(new_groups, 'a+')
+ if new_repos and args.group:
+ gname = args.group
+ gname_repos = set(groups[gname]['repos'])
+ gname_repos.update(new_repos)
+ groups[gname]['repos'] = sorted(gname_repos)
+ print(f'Added {len(new_repos)} repos to the {gname} group')
+ utils.write_to_groups_file(groups, 'w')
def f_rename(args: argparse.Namespace):
@@ -112,6 +120,8 @@ def f_color(args: argparse.Namespace):
writer = csv.DictWriter(f, fieldnames=colors)
writer.writeheader()
writer.writerow(colors)
+ elif cmd == 'reset':
+ Path(common.get_config_fname('color.csv')).unlink(missing_ok=True)
def f_info(args: argparse.Namespace):
@@ -389,6 +399,9 @@ def main(argv=None):
p_add = subparsers.add_parser('add', description='add repo(s)',
help='add repo(s)')
p_add.add_argument('paths', nargs='+', type=_path_name, help="repo(s) to add")
+ p_add.add_argument('-g','--group',
+ choices=utils.get_groups(),
+ help="add repo(s) to the specified group")
xgroup = p_add.add_mutually_exclusive_group()
xgroup.add_argument('-r', '--recursive', action='store_true',
help="recursively add repo(s) in the given path(s).")
@@ -455,6 +468,8 @@ def main(argv=None):
help='additional help with sub-command -h')
color_cmds.add_parser('ll',
description='display available colors and the current branch coloring in the ll sub-command')
+ color_cmds.add_parser('reset',
+ description='reset color scheme.')
pc_set = color_cmds.add_parser('set',
description='Set color for local/remote situation.')
pc_set.add_argument('situation',
@@ -594,8 +609,8 @@ def main(argv=None):
'man',
nargs=argparse.REMAINDER,
help="execute arbitrary git command/alias for specified repo(s), group(s), or all repos.\n"
- "Example: gita super myrepo1 diff --name-only --staged\n"
- "Another: gita super checkout master ")
+ "Example: gita super repo1 diff --name-only --staged;\n"
+ "gita super checkout master ")
p_super.set_defaults(func=f_super)
# shell mode
diff --git a/setup.py b/setup.py
index 9941251..8a19666 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ with open('README.md', encoding='utf-8') as f:
setup(
name='gita',
packages=['gita'],
- version='0.15.7.3',
+ version='0.15.8',
license='MIT',
description='Manage multiple git repos with sanity',
long_description=long_description,