Add support for getting the revision number from git

Originally committed to SVN as r6174.
This commit is contained in:
Thomas Goyne 2011-12-28 01:22:49 +00:00
parent f02ccdd331
commit b7cd695cd6

View file

@ -161,6 +161,9 @@ AS_IF([test -d "$srcdir/.svn"], [
], [test -f "$srcdir/svn_revision"], [
SVN_REVISION=`cat $srcdir/svn_revision`
AC_MSG_RESULT([$SVN_REVISION from "$srcdir/svn_revision"])
], [test -d "$srcdir/../.git"], [
SVN_REVISION=[`git log | grep git-svn-id -m 1 | sed 's/.*@\([0-9]\+\) .*/\1/'`]
AC_MSG_RESULT([$SVN_REVISION from git])
], [
AC_MSG_RESULT([not found])
AC_MSG_FAILURE([unable to get SVN Revision from $srcdir/svn_revision or 'svnversion $srcdir'])