Skip to content

Commit b38020a

Browse files
author
Sverre Rabbelier
committed
Improved the GIT_PYTHON_TRACE=full output format
It now also shows stderr if there was any on it, and only shows stdout if there was any output. Also added a '->' between the command and the return value as a visual clue.
1 parent 9b63b3b commit b38020a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/git/cmd.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ def execute(self, command,
107107
status = proc.wait()
108108
proc.stdout.close()
109109

110+
if proc.stderr:
111+
stderr_value = proc.stderr.read()
112+
proc.stderr.close()
113+
110114
# Strip off trailing whitespace by default
111115
if not with_raw_output:
112116
stdout_value = stdout_value.rstrip()
@@ -118,7 +122,12 @@ def execute(self, command,
118122
% (str(command), status))
119123

120124
if GIT_PYTHON_TRACE == 'full':
121-
print "%s %d: '%s'" % (command, status, stdout_value)
125+
if stderr_value:
126+
print "%s -> %d: '%s' !! '%s'" % (command, status, stdout_value, stderr_value)
127+
elif stdout_value:
128+
print "%s -> %d: '%s'" % (command, status, stdout_value)
129+
else:
130+
print "%s -> %d" % (command, status)
122131

123132
# Allow access to the command's status code
124133
if with_status:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy