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 errors - git fails with a confusing error message when a commit doesn't exist in a git repo, used in a stack.yaml config #1453

Closed
athanclark opened this issue Nov 30, 2015 · 4 comments

Comments

@athanclark
Copy link

Hello everybody, this is a casual issue and not immediately detrimental.

In a stack.yaml, if you set a source code location to a git commit that doesn't exist on the referenced repo, then you get the "could not parse object" error, which led me to believe I had somehow pasted my commit hash wrong. For instance, if you have this in your stack.yaml:

packages:
- '.'
- location:
    git: https://github.com/athanclark/foo
    commit: 8e22ca206e9fc8fd7b903afa8b073120f8897793
  extra-dep: true

and you tried to stack build, you would get the error:

Running /usr/bin/git reset --hard 8e22ca206e9fc8fd7b903afa8b073120f8897793 exited with ExitFailure 128

fatal: Could not parse object '8e22ca206e9fc8fd7b903afa8b073120f8897793'.

Which is misleading.

@mgsloan
Copy link
Contributor

mgsloan commented Nov 30, 2015

It'd make sense to me to add a message like Please ensure that commit 8e22ca206e9fc8fd7b903afa8b073120f8897793 exists within https://github.com/athanclark/foo when that command fails (but also provide the command output).

@mrkkrp
Copy link
Collaborator

mrkkrp commented Dec 1, 2015

@mgsloan, Where this thing is processed? Where should one start to look to add this message?

@mgsloan
Copy link
Contributor

mgsloan commented Dec 2, 2015

@mrkkrp here

@mgsloan
Copy link
Contributor

mgsloan commented Dec 12, 2015

It's fixed, thanks @mrkkrp

Running /usr/bin/git reset --hard 8e22ca206e9fc8fd7b903afa8b073120f8897793 exited with ExitFailure 128

fatal: Could not parse object '8e22ca206e9fc8fd7b903afa8b073120f8897793'.

Please ensure that commit 8e22ca206e9fc8fd7b903afa8b073120f8897793 exists within https://github.com/ekmett/lens

@mgsloan mgsloan closed this as completed Dec 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants