-svn_revision=`svn info | grep Revision | grep -o -E '[0-9]+'`
-git_commitcount=0
-if test "x$svn_revision" = "x" ; then
- svn_revision=`git log -n 1 --pretty="format:%h"`
- if test "x$svn_revision" = "x" ; then
- svn_revision="0"
+
+git_revision_id=`git rev-list -n 1 --pretty="format:%h" --header refs/heads/master | grep '^[0-9a-f]*$'`
+if test "x$git_revision_id" = "x" ; then
+ git_revision="0"
+ git_commitcount="0"
+ git_is_stable="1"
+ git_dev_rev=""
+else
+ git_commitcount=`git rev-list --oneline --first-parent refs/heads/master | wc -l | sed "s/[ \t]//g"`
+ git_revision="git-$git_revision_id"
+
+ git_real_revision_id=`git rev-list -n 1 --pretty="format:%h" --header HEAD | grep '^[0-9a-f]*$'`
+ if test "$git_revision_id" = "$git_real_revision_id" ; then
+ git_is_stable="1"
+ git_dev_rev=""