Get a version using git that includes number of commits since last tag and hash commit:

git describe --long --tags --dirty --always
v0.1.0-39-gf7f059f
^       ^ ^
|       | |
|       | SHA of HEAD
|       |
|       number of commits since last tag
|
last tag

Compact log lines using a custom format template:

git log --pretty=format:"%h|%ad|%s" -1 --date=short
f7f059f|2013-12-10|Added travis support.
git log --pretty=format:"%H|%ad|%s" -1 --date=short
f7f059f739a3426bb3509bf454ece02a1924f6e6|2013-12-10|Added travis support.