1#!/bin/sh
2#
3# The aim of this hook is to update the VERSION file at the root of XLiFE++ project
4# when you call the git commit command
5# you can skip it by adding --no-verify option to the git commit command
6#
7
8release=$(git tag -l | tail -1)
9revisionHead=$(git rev-list --count HEAD)
10revisionTag=$(git rev-list --count $release)
11revision=$(expr $revisionHead - $revisionTag + 1)
12date=$(date +%F)
13echo "OVERVIEW: XLiFE++ source files" > VERSION.txt
14echo "VERSION: $release-r$revision" >> VERSION.txt
15echo "DATE: $date" >> VERSION.txt
16git add VERSION.txt
17