Merging upstream version 0.15.9.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
6e213cec35
commit
a8de33be73
4 changed files with 21 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue