summaryrefslogtreecommitdiffstats
path: root/subcmds/init.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2020-02-21 23:55:07 -0500
committerMike Frysinger <vapier@google.com>2020-02-22 06:31:22 +0000
commitedd3d45b35c33e06f9d2f569d4fb1d9c9c739151 (patch)
tree73158f67275ef5a95ead8b2f8736cd2c86a7eaf1 /subcmds/init.py
parent71928c19a671b78ed39578d675d1d8b969a21a38 (diff)
downloadgit-repo-edd3d45b35c33e06f9d2f569d4fb1d9c9c739151.tar.gz
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 <vapier@google.com> Reviewed-by: Jonathan Nieder <jrn@google.com>
Diffstat (limited to 'subcmds/init.py')
-rw-r--r--subcmds/init.py12
1 files changed, 9 insertions, 3 deletions
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.
87 def _Options(self, p, gitc_init=False): 87 def _Options(self, p, gitc_init=False):
88 # Logging 88 # Logging
89 g = p.add_option_group('Logging options') 89 g = p.add_option_group('Logging options')
90 g.add_option('-v', '--verbose',
91 dest='output_mode', action='store_true',
92 help='show all output')
90 g.add_option('-q', '--quiet', 93 g.add_option('-q', '--quiet',
91 dest="quiet", action="store_true", default=False, 94 dest='output_mode', action='store_false',
92 help="be quiet") 95 help='only show errors')
93 96
94 # Manifest 97 # Manifest
95 g = p.add_option_group('Manifest options') 98 g = p.add_option_group('Manifest options')
@@ -300,7 +303,7 @@ to update the working directory files.
300 if opt.submodules: 303 if opt.submodules:
301 m.config.SetString('repo.submodules', 'true') 304 m.config.SetString('repo.submodules', 'true')
302 305
303 if not m.Sync_NetworkHalf(is_new=is_new, quiet=opt.quiet, 306 if not m.Sync_NetworkHalf(is_new=is_new, quiet=opt.quiet, verbose=opt.verbose,
304 clone_bundle=opt.clone_bundle, 307 clone_bundle=opt.clone_bundle,
305 current_branch_only=opt.current_branch_only, 308 current_branch_only=opt.current_branch_only,
306 tags=opt.tags, submodules=opt.submodules, 309 tags=opt.tags, submodules=opt.submodules,
@@ -483,6 +486,9 @@ to update the working directory files.
483 % ('.'.join(str(x) for x in MIN_GIT_VERSION_SOFT),), 486 % ('.'.join(str(x) for x in MIN_GIT_VERSION_SOFT),),
484 file=sys.stderr) 487 file=sys.stderr)
485 488
489 opt.quiet = opt.output_mode is False
490 opt.verbose = opt.output_mode is True
491
486 if opt.worktree: 492 if opt.worktree:
487 # Older versions of git supported worktree, but had dangerous gc bugs. 493 # Older versions of git supported worktree, but had dangerous gc bugs.
488 git_require((2, 15, 0), fail=True, msg='git gc worktree corruption') 494 git_require((2, 15, 0), fail=True, msg='git gc worktree corruption')