Another approach would be to just use the git CLI, wrapped with sh and baked, like it is done for openstack in Enough. However the output of git cannot be conveniently parsed, contrary to openstack which is always available as a JSON structure.
Reason why I chose to use a mixture of calls to the git CLI and GitPython:
- GitPython when the output is needed (like checking the hash commits etc.)
- git when the exit status is all that’s needed