-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Improve git binary error #3557
Description
- I'd be willing to implement this feature (contributing guide)
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:
lerna/libs/core/src/lib/command/index.ts
Line 270 in ce2ceca
| 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.