diff options
-rw-r--r-- | configure.in | 2 | ||||
-rwxr-xr-x | gitrev.sh | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/configure.in b/configure.in index e59ccf711d..e3d74b94af 100644 --- a/configure.in +++ b/configure.in @@ -898,7 +898,7 @@ if ! test -n "$SVN_REV" -a "$SVN_REV" != "" ; then fi if test "$SVN_REV" = ""; then if test "$HAVE_GIT" = "yes"; then - SVN_REV=$(echo -n `git svn info 2>/dev/null | grep ^Revision | cut -d' ' -f2`) + SVN_REV=$(echo -n `sh gitrev.sh`) fi fi if test "$SVN_REV" = ""; then diff --git a/gitrev.sh b/gitrev.sh new file mode 100755 index 0000000000..a1ade00a18 --- /dev/null +++ b/gitrev.sh @@ -0,0 +1,15 @@ +#!/bin/sh +N=0 +R="" +MAX=1 +while [[ $N -le $MAX && "x$R" == "x" ]] +do + R=$(git log -1 --pretty=format:%b HEAD~$N | sed -e 's/.*@\([0-9]\+\) .*/\1/') + N=$[$N+1] +done +if [[ "x$R" != "x" ]]; then + if [[ $N > 1 ]]; then + R=$R\+$((N-1)) + fi + echo $R +fi |