[BUGFIX] Consider output of stderr in successful cases - #206
[BUGFIX] Consider output of stderr in successful cases#206andreaskienast wants to merge 1 commit into
stderr in successful cases#206Conversation
Git writes the output of some commands into `stderr` instead of `stdout` (e.g. `push`). Using the option `--porcelain` doesn't always help in such cases as other information may be missing. To get the full output, `stderr` is now fetched in case `stdout` is empty. Fixes: gitonomy#205
The library `gitonomy/gitlib` has an issue with fetching the output of Git commands, as some output is written to `stderr`. There's a pending pull request addressing this issue [1], which is now installed instead. [1] gitonomy/gitlib#206
|
It's been three years, any update on this? |
|
Sorry, I missed that. Could you write a test? |
|
Thanks for the fix! I looked into this closer and I think the current approach has a correctness problem that's worth addressing before merging. The core issue$output = $process->getOutput() ?: $process->getErrorOutput();This conflates two different situations:
Since the fallback is applied unconditionally inside the single shared Concrete regressions this introduces
Smaller points
Suggested directionRather than changing the contract of the shared |
Git writes the output of some commands into
stderrinstead ofstdout(e.g.push). Using the option--porcelaindoesn't always help in such cases as other information may be missing. To get the full output,stderris now fetched in casestdoutis empty.Fixes: #205