Skip to content

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

@athanclark

Description

@athanclark

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions