From: Wilfried Göesgens Date: Sat, 12 Jun 2010 21:41:22 +0000 (+0000) Subject: * detect git repostories and branches X-Git-Tag: v7.86~161 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=b8a90b25d5c8fc6bce29048b51d66a9fdc46bba7;p=citadel.git * detect git repostories and branches --- diff --git a/citadel/scripts/mk_svn_revision.sh b/citadel/scripts/mk_svn_revision.sh index b94a7b8ce..35ad0dc94 100755 --- a/citadel/scripts/mk_svn_revision.sh +++ b/citadel/scripts/mk_svn_revision.sh @@ -20,16 +20,25 @@ if test -d $SRC_DIR/.svn ; then if test -x $SVNVERSION ; then echo "have svnversion at $SVNVERSION" BUILD=`svnversion -n .` - echo "This code base revision $BUILD" + echo "This code base svn-revision: $BUILD" CAN_BUILD_SVN_REVISION="yes" fi +else + if git status> /dev/null 2>&1; then + echo "have Git repository." + TAG=`git rev-parse HEAD` + BRANCH="`git show-branch |sed 's;\[\(.*\)\].*;\1;'`" + BUILD="GIT: $BRANCH : $TAG" + echo "This code base git-revision: $BUILD" + CAN_BUILD_SVN_REVISION="yes" + fi fi if [ "$CAN_BUILD_SVN_REVISION" = "yes" ] ; then cat < $C_FILE /* - * Subversion revision functions + * Subversion / GIT revision functions * * Autogenerated at make/release time * @@ -48,7 +57,7 @@ elif test ! -f $C_FILE ; then cat < $C_FILE /* - * Subversion revision functions + * Subversion / GIT revision functions * * Autogenerated at make time *