BrightcoveOS/Diamond — pull request #640 by keen99 (2014-06-03 20:25:42+00:00)
Title: can we include the commit hash in the version number?

the quick and dirty change is here (plenty of other ways to achieve it), but the idea is to include the hash from git-describe.

Without it, you can't really identify exactly what commits were in a build, you only know that you were (for example) 226 commits ahead of tag v3.4. But since commits can be removed, and merges can add commits in between other commits, we lose our exact position. Not to mention I can't "git log v3.4-458" but I -can- "git log v3.4-458-gcaff2fe"

I've tested the make rpm case, and this change is handled fine (even to converting the hyphen to an underscore where needed) - but dont have resources to test any other version consumers.

the time it takes to track back to what build went into:

diamond-3.4.458_gcaff2fe-0.noarch.rpm

is far far far less than

diamond-3.4.226-0.noarch.rpm

(you do, however, still need to grok git describe and it's versioning - or notice that you can drop the g from the front of the hash to see the short commit hash..)