File: pre-commit

package info (click to toggle)
pgrouting 2.3.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,624 kB
  • ctags: 3,244
  • sloc: cpp: 86,010; sql: 30,138; ansic: 9,711; python: 3,105; perl: 1,307; sh: 957; xml: 182; makefile: 126
file content (25 lines) | stat: -rwxr-xr-x 738 bytes parent folder | download
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
#!/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 
    COMMITS=`git rev-list HEAD --count`
    HASH=`git rev-parse --short HEAD`
    BRANCH=`git branch | grep '*' | awk '{print $2}'`
    echo $COMMITS-$HASH $BRANCH > $GIT_DIR/../VERSION
    git add $GIT_DIR/../VERSION
fi