1
0
Fork 0

progress: hide progress bar when --quiet

We want progress bars in the default output mode, but not when the
user specifies --quiet.  Add a setting to the Progress bar class so
it takes care of not displaying anything itself rather than having
to update every subcommand to conditionally setup & call the object.

Change-Id: I1134993bffc5437bc22e26be11a512125f10597f
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/303225
Reviewed-by: Raman Tenneti <rtenneti@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Mike Frysinger 2021-04-13 15:07:21 -04:00
parent 9180a07b8f
commit 151701e85f
5 changed files with 16 additions and 8 deletions

View file

@ -59,7 +59,7 @@ The command is equivalent to:
err.append(project)
pm.update()
pm = Progress('Checkout %s' % nb, len(all_projects))
pm = Progress('Checkout %s' % nb, len(all_projects), quiet=opt.quiet)
# NB: Multiprocessing is heavy, so don't spin it up for one job.
if len(all_projects) == 1 or opt.jobs == 1:
_ProcessResults(self._ExecuteOne(nb, x) for x in all_projects)