#!/bin/bash
# ------------------------------------------------------------------------------
# Git Tweaks
# Copyright(c) pgRouting Contributors
#
# About:
# ------
# This script writes the current Git version into the VERSION file
# To trigger this together with every commit, run
#
#	cp tools/pre-commit .git/hooks/pre-commit
#
# Note:
# -----
# The VERSION file is always one commit behind HEAD
# ------------------------------------------------------------------------------

VERSION="pgrouting-2.3.0.dev"
COMMITS=`git rev-list HEAD --count`
HASH=`git rev-parse --short HEAD`
BRANCH=`git branch | grep '*' | awk '{print $2}'`
echo $VERSION-$COMMITS-$HASH $BRANCH > $GIT_DIR/../VERSION
