Correct LIBGIT2_VERSION name and add documentation

LIBGIT2_VERSION was previously recorded as LIBGIT2_VER_VERSION which is
incorrect.

We also add basic explanations to all the constants so that the page is
a little less bare. Perhaps this should be done as autodoc style
comments in the code but I guess not.
Provide a doc example for discover_repository

To clarify the behaviour and usage.