qgit icon indicating copy to clipboard operation
qgit copied to clipboard

Git hook output shown as errors irrespectively of the exit code

Open tibirna opened this issue 7 years ago • 2 comments

Submitted by Andrey Rahmatullin on 2016-03-27. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=791484

“"” I have a local pre-commit hook set up to run some stuff right before the actual commit. This works just fine when committing on the command-line. However, when I commit in QGit, it pops up a message saying that there was an error committing and showing the output of the pre-commit hook. There was no error, the exit code of everything is 0 when I run this on the CLI. QGit should thus not say anything about errors, and it should re-load the commit log to show the new commit. “"”

tibirna avatar May 21 '18 15:05 tibirna

Just to clarify, qgit seems to think there is an error when the hook prints out something.

filiperinaldi avatar Aug 28 '18 12:08 filiperinaldi

Ok, looking further, it is actually intentional that QGit does not look only into the exit code, but also on the stderr. In this case, I believe the user's git hook was printing debug/info on the stderr. Perhaps qgit could be more helpful and say something like "...the command succeeded, but output the following message on the stderr...".

filiperinaldi avatar Aug 28 '18 16:08 filiperinaldi