1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
#!/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
# ------------------------------------------------------------------------------
if [[ $BRANCH == "gh-pages" ]]
then
exit 0
fi
NOTES=`git diff HEAD --name-only doc/src/release_notes.rst`
NOTES2NEWS=`git diff HEAD --name-only tools/release-scripts/notes2news.pl`
NEWS=`git diff HEAD --name-only NEWS`
if [[ "b$NOTES" == "bdoc/src/release_notes.rst" || "b$NOTES2NEWS" == "btools/release-scripts/notes2news.pl" || "b$NEWS" == "NEWS" ]]
then
echo "CHANGED: 'doc/src/release_notes.rst' or 'tools/release-scripts/notes2news.pl' or 'NEWS'"
echo "Regenerating NEWS"
$GIT_DIR/../tools/release-scripts/notes2news.pl
git add $GIT_DIR/../doc/src/release_notes.rst
git add $GIT_DIR/../tools/release-scripts/notes2news.pl
git add $GIT_DIR/../NEWS
fi
COMMITS=`git rev-list HEAD --count`
HASH=`git rev-parse --short HEAD`
BRANCH="release/3.0"
#BRANCH="master"
echo $COMMITS-$HASH $BRANCH > $GIT_DIR/../VERSION
git add $GIT_DIR/../VERSION
|