I am using Sphinx to document a project, for publication on Read the Docs.
Some of the content needs to link to some files in the GitHub repo, so that the version of file linked to matches the version of code being documented.
For example, if the documentation is of revision 2f5dabe0
, then I might want to link to:
https://github.com/approvals/ApprovalTests.cpp/blob/2f5dabe0/tests/UT_Tests/UTApprovalTestTests.cpp#L58-L73
Or with the full commit ID:
https://github.com/approvals/ApprovalTests.cpp/blob/2f5dabe0a533deeedc025d595d5534967737fed5/tests/UT_Tests/UTApprovalTestTests.cpp#L58-L73
Without adding any dependencies (such as GitPython), how can I obtain the Git Commit ID in Sphinx's conf.py?