Skip to content

Commit

Permalink
Use git's version number for releases.
Browse files Browse the repository at this point in the history
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
dustin committed Mar 26, 2009
1 parent 496384c commit 923a335
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -33,4 +33,5 @@ memcached-*.tar.gz
doc/protocol-binary-range.txt
doc/protocol-binary.txt
/sizes
/internal_tests
/internal_tests
/version.m4
2 changes: 1 addition & 1 deletion Makefile.am
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions autogen.sh
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion 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)
Expand Down
8 changes: 8 additions & 0 deletions 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.