commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

`cz changelog` is not reporting git errors (`git.py` missing `cmd.return_code` checks)

Open bhelgs opened this issue 3 years ago • 3 comments

Description

cz commit worked just fine, but cz changelog resulted in the error:

"No commits found"

I later came to find the calls to git were silently failing in git.get_tags due to an unsupported version of git. It's not very obvious the issue is with git. Might we want some kind of warnings/exceptions here"?

Steps to reproduce

  1. unsupported git (e.g. 1.8.3.1) (normally we use a newer version)
  2. cz changelog (cz commit worked)

Current behavior

Error handling could be improved.

Desired behavior

Maybe a warning or raise would help users out when cmd.run( ...git...) fails?

Screenshots

No response

Environment

CentOS7

bhelgs avatar May 24 '22 01:05 bhelgs

If you'd like to see a PR just let me know if/what you'd like. I've already made a few cz alterations for my teams anyway.

bhelgs avatar May 24 '22 01:05 bhelgs

Sorry for the late reply. Yep, this is something we missed. Would be great if you're interested in sending a PR 🙂

Lee-W avatar Jul 22 '22 15:07 Lee-W

Sounds good. No problem.

bhelgs avatar Jul 22 '22 18:07 bhelgs