Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error message when cherry_picker is called in wrong state #119

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

serhiy-storchaka
Copy link
Member

Fixes #99.

try:
chosen_config_path, config = load_config(config_path)
except ValueError as exc:
click.echo("You're not inside a Git tree right now! \U0001F645", err=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this ValueError is expected to be raised by get_sha1_from when executing a git command and an error occurs. But the error may not be caused by the fact that the pwd is not in a git tree; it could be some other errors, like git not being installed.

I suggest just echoing some words like "Got an error when executing git command," and echoing the stderr output from the git command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"You're not inside a cpython repo right now! 🙅" says cherry_picker when I'm in my cpython git repo
2 participants