Hacker News new | ask | show | jobs
by tacticus 4622 days ago
Git describe is what you want.

it will take the nearest tag name and use that as the version with the number of commits from that tag as the release value.