jeresig / pulley

Easy Github Pull Request Lander
MIT License
175 stars 24 forks source link

Testing for errors by string compare on stderr fails with git commands. #69

Open johnjbarton opened 10 years ago

johnjbarton commented 10 years ago

Pulley uses string analysis of stderr to detect errors. Unfortunately git sends normal output to stderr for many of its commands, eg including fetch http://git.661346.n2.nabble.com/Bugreport-Git-responds-with-stderr-instead-of-stdout-td4959280.html

When pulley analyzes stderr, any thing it looks for could be in the normal output.

In particular consider this normal output:

From https://github.com/johnjbarton/traceur-compiler
 * branch            getProtoParent-errors -> FETCH_HEAD
Switched to branch 'master'

and the test in pulley:

                } else if ( /error/.test( stderr ) ) {

and you can see that any branch with the string 'error' will break pulley. And I don't know about you, but I often have branches with 'error' in them, as I fix bugs.

git should send non-zero error code for real errors and pulley could check those with the first arg to the exec callback.