GitPython and git


GitPython which I used years ago is not well documented (the reference section of the documentation is empty and a function as essential as clone_from is difficult to find).

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