ontodev / robot

ROBOT is an OBO Tool
http://robot.obolibrary.org
BSD 3-Clause "New" or "Revised" License
260 stars 74 forks source link

Include git commit hash in --version output #952

Open jamesaoverton opened 2 years ago

jamesaoverton commented 2 years ago

I think this would be good for any version, but especially useful for SNAPSHOT versions.

I'm not sure how to make it happen. I don't want to increase churn by including the hash in a pom.xml or whatever.

I'm also a little worried that you could easily have uncommitted changes, and then the hash is unreliable.

It might also be good to have an ongoing Draft Release here in GitHub that we update with a new JAR from time to time.

balhoff commented 2 years ago

owltools does this:

jim$ owltools --version
git-revision-sha1   447e4156287580cd1510b0371a49c1c99e207d34
git-revision-url    https://github.com/owlcollab/owltools/commit/447e4156287580cd1510b0371a49c1c99e207d34
git-branch  master
git-dirty   true

Maybe a place to look for inspiration.