Thanks to the sbt Process API, you really need very little to include the git hash in your version:
version in ThisBuild := "1.0-" + Process("git rev-parse HEAD").lines.head
Use git rev-parse --short HEAD for a short version of the git hash.
Of course, for better reuse, you can move the Process part to your own setup and just do something like:
version in ThisBuild <<= gitSha("1.0-" + _)
source share