summaryrefslogtreecommitdiffstats
path: root/git_command.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2020-02-17 01:35:18 -0500
committerMike Frysinger <vapier@google.com>2020-02-18 03:31:33 +0000
commit31990f009719730c8be9d33b8d6cc94048f6d54b (patch)
tree369ca676378b902dba89918a0a0bca7103892301 /git_command.py
parent16f2fae16f37d0ff77c7ba1ba58ccca036f6358b (diff)
downloadgit-repo-31990f009719730c8be9d33b8d6cc94048f6d54b.tar.gz
project: move successful fetch output behind verbose
Syncing projects works fine the majority of the time. So rather than dump all of that noisy output to stdout, lets capture it and only show when things fail or in verbose mode. This tidies up the default `repo sync` output. Bug: https://crbug.com/gerrit/11293 Change-Id: I8314dd92e1e6aadeb26e36a8c92610da419684e6 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255413 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'git_command.py')
-rw-r--r--git_command.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/git_command.py b/git_command.py
index c7e94fd0..26668a39 100644
--- a/git_command.py
+++ b/git_command.py
@@ -226,6 +226,7 @@ class GitCommand(object):
226 provide_stdin=False, 226 provide_stdin=False,
227 capture_stdout=False, 227 capture_stdout=False,
228 capture_stderr=False, 228 capture_stderr=False,
229 merge_output=False,
229 disable_editor=False, 230 disable_editor=False,
230 ssh_proxy=False, 231 ssh_proxy=False,
231 cwd=None, 232 cwd=None,
@@ -277,7 +278,7 @@ class GitCommand(object):
277 stdin = None 278 stdin = None
278 279
279 stdout = subprocess.PIPE 280 stdout = subprocess.PIPE
280 stderr = subprocess.PIPE 281 stderr = subprocess.STDOUT if merge_output else subprocess.PIPE
281 282
282 if IsTrace(): 283 if IsTrace():
283 global LAST_CWD 284 global LAST_CWD
@@ -305,6 +306,8 @@ class GitCommand(object):
305 dbg += ' 1>|' 306 dbg += ' 1>|'
306 if stderr == subprocess.PIPE: 307 if stderr == subprocess.PIPE:
307 dbg += ' 2>|' 308 dbg += ' 2>|'
309 elif stderr == subprocess.STDOUT:
310 dbg += ' 2>&1'
308 Trace('%s', dbg) 311 Trace('%s', dbg)
309 312
310 try: 313 try:
@@ -352,7 +355,8 @@ class GitCommand(object):
352 p = self.process 355 p = self.process
353 s_in = platform_utils.FileDescriptorStreams.create() 356 s_in = platform_utils.FileDescriptorStreams.create()
354 s_in.add(p.stdout, sys.stdout, 'stdout') 357 s_in.add(p.stdout, sys.stdout, 'stdout')
355 s_in.add(p.stderr, sys.stderr, 'stderr') 358 if p.stderr is not None:
359 s_in.add(p.stderr, sys.stderr, 'stderr')
356 self.stdout = '' 360 self.stdout = ''
357 self.stderr = '' 361 self.stderr = ''
358 362