From edd3d45b35c33e06f9d2f569d4fb1d9c9c739151 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 21 Feb 2020 23:55:07 -0500 Subject: repo/init: add --verbose flags We don't use these for much yet, but init passes it down to the project sync layers which already has support for verbose mode. Change-Id: I651794f1b300be1688eeccf3941ba92c776812b5 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256454 Tested-by: Mike Frysinger Reviewed-by: Jonathan Nieder --- subcmds/init.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'subcmds/init.py') diff --git a/subcmds/init.py b/subcmds/init.py index af5bc297..be73cecd 100644 --- a/subcmds/init.py +++ b/subcmds/init.py @@ -87,9 +87,12 @@ to update the working directory files. def _Options(self, p, gitc_init=False): # Logging g = p.add_option_group('Logging options') + g.add_option('-v', '--verbose', + dest='output_mode', action='store_true', + help='show all output') g.add_option('-q', '--quiet', - dest="quiet", action="store_true", default=False, - help="be quiet") + dest='output_mode', action='store_false', + help='only show errors') # Manifest g = p.add_option_group('Manifest options') @@ -300,7 +303,7 @@ to update the working directory files. if opt.submodules: m.config.SetString('repo.submodules', 'true') - if not m.Sync_NetworkHalf(is_new=is_new, quiet=opt.quiet, + if not m.Sync_NetworkHalf(is_new=is_new, quiet=opt.quiet, verbose=opt.verbose, clone_bundle=opt.clone_bundle, current_branch_only=opt.current_branch_only, tags=opt.tags, submodules=opt.submodules, @@ -483,6 +486,9 @@ to update the working directory files. % ('.'.join(str(x) for x in MIN_GIT_VERSION_SOFT),), file=sys.stderr) + opt.quiet = opt.output_mode is False + opt.verbose = opt.output_mode is True + if opt.worktree: # Older versions of git supported worktree, but had dangerous gc bugs. git_require((2, 15, 0), fail=True, msg='git gc worktree corruption') -- cgit v1.2.3-54-g00ecf