Skip to content

Improve git binary error #3557

@poteirard

Description

@poteirard

Description

The current error The git binary was not found, or this is not a git repository when there's a problem with git using --since seems a bit unclear.

In my end, what was happening in the CI was that the git binary didn't have the proper ownership permissions to run git rev-parse.

The Git ownership check is explained here: https://github.blog/2022-04-18-highlights-from-git-2-36/#stricter-repository-ownership-checks And here https://stackoverflow.com/a/73488472/1762002

Motivation

It was hard to debug the problem, and I needed to read Lerna's code. So I want to help other people to have a better experience.

Suggested Implementation

I would like change this error message:

throw new ValidationError("ENOGIT", "The git binary was not found, or this is not a git repository.");

To something like:

The git binary was not found, this is not a git repository, or you git doesn't have the right ownership. Run `git rev-parse` to get more details.

Alternate Implementations

We could have more granularity of the errors, like checking if git exists to show a different error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions