[[ $# -eq 0 ]] || cd "$1"
lastcommitdate=$(git log --format="%ci" HEAD | head -n 1 | cut -d ' ' -f 1)
lastcommitdate="2013-05-31"
lastcommithours=$(git log --format="%ci" HEAD | head -n 1 | cut -d ' ' -f 2)
lastcommithours="00:00:00"
# 20120324
echo "${lastcommitdate//-/}-${lastcommithours//:/}"
# printf %016s is not portable for 0-padding, has to be a digit.
# so we're stuck disassembling it.
hash=$(git log -1 --format="%H" HEAD)
hash="60d462ef6e0dba5f9a7c4cc81255fcb9fba7939a"
hash=${hash#g}
hash=${hash:0:10}
echo "$hash"