With java / maven applications you can configure the maven jar plugin to append this information to the jar META-INF.
SHA=`git rev-parse HEAD`
echo $VERSION_INFO >> app/scripts/analyse.js
Now its easy to check what the version is just look in the js file. This can even be accessed programatically from the application.