Skip to content

Error message from git is hidden when a git command fails #100

Open
@gpshead

Description

running cherry_picker 2.2.0 for a 3.12 backport, I get subprocess.CalledProcessError: Command '['git', 'log', '--format=%H', '3.12..']' returned non-zero exit status 128. and nothing else.

I'm left to manually recreate that command line and run it myself to try and figure out what git's damage is. Running git I see fatal: ambiguous argument '3.12..': unknown revision or path not in the working tree. which is better at least, but still not wholly informative (of course it isn't, git is [censored])...

(the real source of my error is likely what shows up when I try this:)

$ git checkout 3.12
error: pathspec '3.12' did not match any file(s) known to git
hint: '3.12' matched more than one remote tracking branch.
...

When git fails, we should at least let git speak for itself (regardless of utility) and not swallow the git error output.

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions