From 3d27c71dd928bd345257055cdf2a6be8f8a09bed Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 19 Aug 2022 06:48:23 -0400 Subject: init: hide identify spam when reinitializing We don't want to keep showing the user config notice when reinitializing existing checkouts, so hide it. Change-Id: Id40610bd683396cbff7e1aefc092c8b77c397783 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/343536 Tested-by: Mike Frysinger Reviewed-by: LaMont Jones --- subcmds/init.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'subcmds/init.py') diff --git a/subcmds/init.py b/subcmds/init.py index 803f39a6..0c979cd4 100644 --- a/subcmds/init.py +++ b/subcmds/init.py @@ -148,7 +148,7 @@ to update the working directory files. return value return a - def _ShouldConfigureUser(self, opt): + def _ShouldConfigureUser(self, opt, existing_checkout): gc = self.client.globalConfig mp = self.manifest.manifestProject @@ -160,7 +160,7 @@ to update the working directory files. mp.config.SetString('user.name', gc.GetString('user.name')) mp.config.SetString('user.email', gc.GetString('user.email')) - if not opt.quiet: + if not opt.quiet and not existing_checkout or opt.verbose: print() print('Your identity is: %s <%s>' % (mp.config.GetString('user.name'), mp.config.GetString('user.email'))) @@ -325,7 +325,7 @@ to update the working directory files. self._SyncManifest(opt) if os.isatty(0) and os.isatty(1) and not self.manifest.IsMirror: - if opt.config_name or self._ShouldConfigureUser(opt): + if opt.config_name or self._ShouldConfigureUser(opt, existing_checkout): self._ConfigureUser(opt) self._ConfigureColor() -- cgit v1.2.3-54-g00ecf