Skip to content

Conversation

@MarshalX
Copy link
Contributor

idea: we don't need to work with git in all cases. for example, path scans could be executed without depending on git. git used to get commit history and so on.

how does it work: GitPython on import tries to find and verify git executable installed in the system. it raises an exception if it can't be found. we can catch this exception and provide a fake git provider, which will throw exceptions only on specific function calls instead of on the module import. all type hints from git module are hidden behind TYPE_CHECKING var

also, these exceptions go via our printers and depend on --output format now (json support for IDE plugins)

elsapet
elsapet previously approved these changes May 27, 2024
Co-authored-by: elsapet <elizabeth@cycode.com>
@MarshalX MarshalX requested a review from elsapet May 28, 2024 09:56
elsapet
elsapet previously approved these changes May 28, 2024
@MarshalX MarshalX merged commit e63c1db into main May 28, 2024
@MarshalX MarshalX deleted the CM-30526-unhandled-error-when-git-is-not-installed branch May 28, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants