Browse files

Check for Git revision rather than SVN one

  • Loading branch information...
1 parent 534f104 commit 69313263e7bde140eba16a87535beb089e4f97c1 @b4n b4n committed Oct 9, 2011
Showing with 7 additions and 22 deletions.
  1. +6 −21 m4/geany-revision.m4
  2. +1 −1 src/main.c
View
27 m4/geany-revision.m4
@@ -4,33 +4,18 @@ dnl "r<revnum>" or to "-1" if the revision can't be found
dnl Also AC_DEFINEs REVISION
AC_DEFUN([GEANY_CHECK_REVISION],
[
- REVISION="r0"
+ REVISION="0"
- AC_MSG_CHECKING([for SVN revision])
+ AC_MSG_CHECKING([for Git revision])
# try Git first
GIT=`which git 2>/dev/null`
if test -d ".git" -a "x${GIT}" != "x" -a -x "${GIT}"; then
- # check for git-svn repo first - find-rev (v1.5.4.1) doesn't always fail with git-only repo
- git svn info &>/dev/null
- if test "x$?" == "x0"; then
- REVISION=r`git svn find-rev origin/trunk 2>/dev/null ||
- git svn find-rev trunk 2>/dev/null ||
- git svn find-rev HEAD 2>/dev/null ||
- git svn find-rev master 2>/dev/null ||
- echo 0`
- fi
- fi
- # then check for SVN
- if test "x${REVISION}" = "xr0"; then
- SVN=`which svn 2>/dev/null`
- if test -d ".svn" -a "x${SVN}" != "x" -a -x "${SVN}"; then
- REVISION=r`$SVN info|grep 'Last Changed Rev'|cut -d' ' -f4`
- fi
+ REVISION=`git rev-parse --short --revs-only HEAD || 0`
fi
- if test "x${REVISION}" != "xr0"; then
+ if test "x${REVISION}" != "x0"; then
AC_MSG_RESULT([$REVISION])
- GEANY_STATUS_ADD([Compiling Subversion revision], [$REVISION])
+ GEANY_STATUS_ADD([Compiling Git revision], [$REVISION])
# call action-if-found
$1
@@ -42,5 +27,5 @@ AC_DEFUN([GEANY_CHECK_REVISION],
$2
fi
- AC_DEFINE_UNQUOTED([REVISION], "$REVISION", [subversion revision number])
+ AC_DEFINE_UNQUOTED([REVISION], "$REVISION", [git revision hash])
])
View
2 src/main.c
@@ -279,7 +279,7 @@ static void main_init(void)
const gchar *main_get_version_string(void)
{
- static gchar full[] = VERSION " (svn >= " REVISION ")";
+ static gchar full[] = VERSION " (git >= " REVISION ")";
if (utils_str_equal(REVISION, "-1"))
return VERSION;

0 comments on commit 6931326

Please sign in to comment.