CM-30526 - Make Git executable optional #230
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)