Even friendlier advice to the novice git SXEmacs
authorNelson Ferreira <nelson.ferreira@ieee.org>
Mon, 18 Apr 2011 17:06:30 +0000 (13:06 -0400)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Mon, 18 Apr 2011 17:06:30 +0000 (13:06 -0400)
contributor.

* autogen.sh: also state one needs to git push --tag
* autogen.sh: if the detected TREE_VERSION differs from the expected, issue a warning

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
autogen.sh

index 3876839..7ad456a 100755 (executable)
@@ -22,6 +22,8 @@ olddir=$(pwd)
 srcdir=$(dirname $0)
 cd "$srcdir"
 
+EXPECTED_TREE_VERSION="22.1.14"
+
 emacs_is_beta=t
 if test -n "$GIT" -a -n "$($GIT symbolic-ref HEAD 2>/dev/null)"; then
        TREE_VERSION="$($GIT tag|tail -n1|tr -d v)"
@@ -29,9 +31,11 @@ if test -n "$GIT" -a -n "$($GIT symbolic-ref HEAD 2>/dev/null)"; then
        IN_GIT="1"
 fi
 if test -z "$TREE_VERSION"; then
-       TREE_VERSION="22.1.14"
+        TREE_VERSION="$EXPECTED_TREE_VERSION"
         if test -n "$IN_GIT"; then
-           echo "If you cloned this branch into your own you should issue: git tag -s v${TREE_VERSION}.<your branch_name>"
+           echo "If you cloned this branch into your own you should issue:"
+           echo "\tgit tag -s v${TREE_VERSION}.<your branch_name>"
+           echo "\tgit push --tag"
        fi
 fi
 if test -z "$GIT_VERSION"; then
@@ -41,9 +45,27 @@ fi
 emacs_major_version="$(echo $TREE_VERSION|cut -d. -f1)"
 emacs_minor_version="$(echo $TREE_VERSION|cut -d. -f2)"
 emacs_beta_version="$(echo $TREE_VERSION|cut -d. -f3)"
+emacs_full_version="$emacs_major_version.$emacs_minor_version.$emacs_beta_version"
 sxemacs_codename="Geo"
 sxemacs_git_version="$GIT_VERSION"
 
+if test "$emacs_full_version" != "$EXPECTED_TREE_VERSION"; then
+    # Note, there is no need check for git repos, because
+    # it can only happen in such a case anyway...
+    echo "*******************************************"
+    echo " WARNING: Your git tags may be out of date "
+    echo ""
+    echo " Expected tree version $EXPECTED_TREE_VERSION "
+    echo " got $emacs_full_version (from $TREE_VERSION) "
+    set -x
+    git tag
+    git describe
+    git describe --long
+    git config -l
+    set +x
+    echo "*******************************************" 
+fi
+
 autoconf_ver=$(autoconf --version 2>/dev/null | head -n1)
 autoheader_ver=$(autoheader --version 2>/dev/null | head -n1)
 automake_ver=$(automake --version 2>/dev/null | head -n1)
@@ -69,7 +91,7 @@ fi
 
 cat>sxemacs_version.m4<<EOF
 dnl autogenerated version number
-m4_define([SXEM4CS_VERSION], [$emacs_major_version.$emacs_minor_version.$emacs_beta_version])
+m4_define([SXEM4CS_VERSION], [$emacs_full_version])
 m4_define([SXEM4CS_MAJOR_VERSION], [$emacs_major_version])
 m4_define([SXEM4CS_MINOR_VERSION], [$emacs_minor_version])
 m4_define([SXEM4CS_BETA_VERSION], [$emacs_beta_version])