Closed shiouen closed 2 years ago
Further investigation shows that Git outputs informative messages to stderr
, as the maintainers believe it is not supposed to be consumed by machines. Semverbot looks at the stderr to detect Git errors which have an exit status equal to 0, but still output to stderr.
How to reproduce:
sbot update version
Not sure what the workaround can be here, afaik Git is not adhering to standards. Will have to investigate further.
On closer inspection, it isn't as strange as I thought to output to stderr as described here. sbot
should solely base its command error handling on the exit code instead, to fix this issue.
Issue should be fixed by not depending on stderr to detect errors and a custom error implementation for running commands
fixed in 0.2.8
These logs/prints are shown due to the git command exit status being different that 0 or the stderr containing bytes when it really shouldn't. Semverbot still works as intended but simply outputs strange logs.
The go Cobra library shows usage whenever an error occurs, even when the error is not due to faulty usage of the CLI. We can fix this with a combination of a logging implementation and using
cmd.SilenceUsage = true
.