From 37fb0ff88466793c7cbec5e68782584f94ccf787 Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Thu, 20 Feb 2014 11:14:33 +0000 Subject: [PATCH] AX_DETECT_GIT_HEAD: avoid empty version string Use the --always option of git describe, such that we at least get a commit object name in case of e.g. absence of tags. Signed-off-by: Sven van Haastregt Signed-off-by: Sven Verdoolaege --- m4/ax_detect_git_head.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/m4/ax_detect_git_head.m4 b/m4/ax_detect_git_head.m4 index c3326277..31a6fe32 100644 --- a/m4/ax_detect_git_head.m4 +++ b/m4/ax_detect_git_head.m4 @@ -6,11 +6,11 @@ AC_DEFUN([AX_DETECT_GIT_HEAD], [ gitdir=`GIT_DIR=$srcdir/.git git rev-parse --git-dir` GIT_HEAD="$gitdir/index" GIT_REPO="$gitdir" - GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe` + GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe --always` elif test -f $srcdir/.git/HEAD; then GIT_HEAD="$srcdir/.git/index" GIT_REPO="$srcdir/.git" - GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe` + GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe --always` elif test -f $srcdir/GIT_HEAD_ID; then GIT_HEAD_ID=`cat $srcdir/GIT_HEAD_ID` else @@ -27,6 +27,6 @@ AC_DEFUN([AX_DETECT_GIT_HEAD], [ if test -z "$GIT_REPO" ; then GIT_HEAD_VERSION="$GIT_HEAD_ID" else - GIT_HEAD_VERSION="\`GIT_DIR=$GIT_REPO git describe\`" + GIT_HEAD_VERSION="\`GIT_DIR=$GIT_REPO git describe --always\`" fi ]) -- 2.11.4.GIT