summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2022-08-19 06:48:23 -0400
committerMike Frysinger <vapier@google.com>2022-08-22 21:01:35 +0000
commit3d27c71dd928bd345257055cdf2a6be8f8a09bed (patch)
treefdfdc4dd7760f6923c2467a49b012c7ea1974f3f
parent488d54d4eea1e0bae5c6056ae628b783d4f716c0 (diff)
downloadgit-repo-3d27c71dd928bd345257055cdf2a6be8f8a09bed.tar.gz
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 <vapier@google.com> Reviewed-by: LaMont Jones <lamontjones@google.com>
-rw-r--r--subcmds/init.py6
1 files changed, 3 insertions, 3 deletions
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.
148 return value 148 return value
149 return a 149 return a
150 150
151 def _ShouldConfigureUser(self, opt): 151 def _ShouldConfigureUser(self, opt, existing_checkout):
152 gc = self.client.globalConfig 152 gc = self.client.globalConfig
153 mp = self.manifest.manifestProject 153 mp = self.manifest.manifestProject
154 154
@@ -160,7 +160,7 @@ to update the working directory files.
160 mp.config.SetString('user.name', gc.GetString('user.name')) 160 mp.config.SetString('user.name', gc.GetString('user.name'))
161 mp.config.SetString('user.email', gc.GetString('user.email')) 161 mp.config.SetString('user.email', gc.GetString('user.email'))
162 162
163 if not opt.quiet: 163 if not opt.quiet and not existing_checkout or opt.verbose:
164 print() 164 print()
165 print('Your identity is: %s <%s>' % (mp.config.GetString('user.name'), 165 print('Your identity is: %s <%s>' % (mp.config.GetString('user.name'),
166 mp.config.GetString('user.email'))) 166 mp.config.GetString('user.email')))
@@ -325,7 +325,7 @@ to update the working directory files.
325 self._SyncManifest(opt) 325 self._SyncManifest(opt)
326 326
327 if os.isatty(0) and os.isatty(1) and not self.manifest.IsMirror: 327 if os.isatty(0) and os.isatty(1) and not self.manifest.IsMirror:
328 if opt.config_name or self._ShouldConfigureUser(opt): 328 if opt.config_name or self._ShouldConfigureUser(opt, existing_checkout):
329 self._ConfigureUser(opt) 329 self._ConfigureUser(opt)
330 self._ConfigureColor() 330 self._ConfigureColor()
331 331