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

Projects
None yet
3 participants
@athanclark

athanclark commented Nov 30, 2015

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

This comment has been minimized.

Collaborator

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

This comment has been minimized.

Collaborator

mrkkrp commented Dec 1, 2015

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

@mgsloan

This comment has been minimized.

Collaborator

mgsloan commented Dec 2, 2015

@mgsloan

This comment has been minimized.

Collaborator

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 Dec 12, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment