trustymail icon indicating copy to clipboard operation
trustymail copied to clipboard

It would be nice to add the latest commit hash to __init__.py

Open jsf9k opened this issue 7 years ago • 2 comments

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.

jsf9k avatar Nov 30 '17 15:11 jsf9k

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.

IanLee1521 avatar Dec 04 '17 04:12 IanLee1521

Thanks, @IanLee1521. I didn't know about git describe --tags.

jsf9k avatar Dec 04 '17 13:12 jsf9k