From 05e8b658e633f37456340b83b01fa304f9fcc5d3 Mon Sep 17 00:00:00 2001 From: Daniel Folkinshteyn Date: Fri, 20 Aug 2010 11:08:31 -0400 Subject: [PATCH] Add script to automatically update version with a datestamp upon commit. --- sandbox/version-commit | 10 ++++++++++ src/version.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 sandbox/version-commit diff --git a/sandbox/version-commit b/sandbox/version-commit new file mode 100755 index 000000000..2a41cd134 --- /dev/null +++ b/sandbox/version-commit @@ -0,0 +1,10 @@ +#!/bin/bash +# Use this script to make commits. It will automatically update the version +# string to have a datetime stamp, prior to committing. +# All arguments get passed to git commit, so of course, use the -a option so that +# the version change gets added to the commit. +echo "Updating version..." +perl -pi -e "s/^version\s*=\s*['\"]([\S]+)[ '\"].*/version = '\1 ($( date -Iseconds ))'/" src/version.py +if [ "$?" -eq "0" ]; then + git commit $@ +fi diff --git a/src/version.py b/src/version.py index f87586219..33e683489 100644 --- a/src/version.py +++ b/src/version.py @@ -1,3 +1,3 @@ """stick the various versioning attributes in here, so we only have to change them once.""" -version = '0.83.4.1+gribble' +version = '0.83.4.1+gribble (2010-08-20T11:08:31-0400)'