trustymail
trustymail copied to clipboard
It would be nice to add the latest commit hash to __init__.py
It would be nice to somehow add the latest commit hash as part of the version string or as a separate variable in __init__.py
. This would be a useful piece of information to have when debugging issues reported by third parties, since they can always check out some random branch or commit instead of using what is in PyPI. If we proceed with #36, this would be particularly useful when debugging code built from the develop
branch.
I'm not quite sure how to implement this (maybe via a git hook), but this information can be obtained via git rev-parse HEAD
.
I usually use git describe [--tags]
to get this information, as in:
> git describe --tags
0.3.0-3-g47d112c
Where the last tagged version is 0.3.0
, we are 3
commits from it, and our git commit hash is 47d112c
.
Thanks, @IanLee1521. I didn't know about git describe --tags
.