Permalink
Browse files

Use git's version number for releases.

This will allow more specific version numbers, while simplifying a
proper release down to a tag and make dist.

During development, ./version.sh needs to run periodically to update
the version number.  I'd recommend just adding a call to version.sh as
a git post commit hook:

% cat .git/hooks/post-commit

echo "Updating version."
./version.sh

(and make sure the file is executable)
  • Loading branch information...
1 parent 496384c commit 923a335bf8613696d658448cd9c48a963924d436 @dustin dustin committed Mar 9, 2009
Showing with 16 additions and 3 deletions.
  1. +2 −1 .gitignore
  2. +1 −1 Makefile.am
  3. +3 −0 autogen.sh
  4. +2 −1 configure.ac
  5. +8 −0 version.sh
View
3 .gitignore
@@ -33,4 +33,5 @@ memcached-*.tar.gz
doc/protocol-binary-range.txt
doc/protocol-binary.txt
/sizes
-/internal_tests
+/internal_tests
+/version.m4
View
2 Makefile.am
@@ -58,7 +58,7 @@ memcached_debug_dtrace.o: $(memcached_debug_OBJECTS)
SUBDIRS = doc
DIST_DIRS = scripts
-EXTRA_DIST = doc scripts TODO t memcached.spec memcached_dtrace.d
+EXTRA_DIST = doc scripts TODO t memcached.spec memcached_dtrace.d version.m4
MOSTLYCLEANFILES = *.gcov *.gcno *.gcda *.tcov
View
3 autogen.sh
@@ -7,6 +7,9 @@
# apt-get install automake1.7 autoconf
#
+# Get the initial version.
+sh version.sh
+
echo "aclocal..."
ACLOCAL=`which aclocal-1.10 || which aclocal-1.9 || which aclocal19 || which aclocal-1.7 || which aclocal17 || which aclocal-1.5 || which aclocal15 || which aclocal || exit 1`
$ACLOCAL || exit 1
View
3 configure.ac
@@ -1,5 +1,6 @@
AC_PREREQ(2.52)
-AC_INIT(memcached, 1.3.2, brad@danga.com)
+m4_include([version.m4])
+AC_INIT(memcached, VERSION_NUMBER, brad@danga.com)
AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR(memcached.c)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
View
8 version.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+if git describe > version.tmp
+then
+ echo "m4_define([VERSION_NUMBER], [`tr -d '\n' < version.tmp`])" \
+ > version.m4
+fi
+rm version.tmp

0 comments on commit 923a335

Please sign in to comment.