# HG changeset patch # User Marcin Kuzminski # Date 2017-05-17 14:15:00 # Node ID 427ed58b3a3a33f38ba79ff87619acea62fa1424 # Parent 55e22a8ed0fdc12181c07a45b43b2c2d02d6fe24 hooks: show git stderr when git hook execution fails. - help with debugging. diff --git a/vcsserver/hooks.py b/vcsserver/hooks.py --- a/vcsserver/hooks.py +++ b/vcsserver/hooks.py @@ -313,12 +313,12 @@ def _run_command(arguments): # Probably this should be using subprocessio. process = subprocess.Popen( arguments, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - stdout, _ = process.communicate() + stdout, stderr = process.communicate() if process.returncode != 0: raise Exception( - 'Command %s exited with exit code %s' % (arguments, - process.returncode)) + 'Command %s exited with exit code %s: stderr:%s' % ( + arguments, process.returncode, stderr)) return stdout