File: pre-commit

package info (click to toggle)
mpich 5.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 251,828 kB
  • sloc: ansic: 1,323,147; cpp: 82,869; f90: 72,420; javascript: 40,763; perl: 28,296; sh: 19,399; python: 16,191; xml: 14,418; makefile: 9,468; fortran: 8,046; java: 4,635; pascal: 352; asm: 324; ruby: 176; awk: 27; lisp: 19; php: 8; sed: 4
file content (34 lines) | stat: -rwxr-xr-x 1,103 bytes parent folder | download | duplicates (8)
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
#!/bin/bash

# This hook may be installed in .git/hooks (or ~/.git_template for future clones)
# and additional/custom checks may be added if needed.

function die() {
    rc=$1
    shift;
    printf "*** GIT PRE-COMMIT HOOK FAILED ***:\n"
    echo "$@"
    exit $rc
}

if test -f contrib/git-hooks/check-versions.sh; then
   echo "=== Checking versions..."
   ./contrib/git-hooks/check-versions.sh || die $? "Versions are not up to date"
else
   echo "=== No check-versions.sh script -- skipping"
fi

if test -f contrib/git-hooks/check-manpages-completions.pl; then
   echo "=== Checking manpages and completions..."
   ./contrib/git-hooks/check-manpages-completions.pl || die $? "Manpages or completions are not up to date"
else
   echo "=== No check-manpages-completions.pl script -- skipping"
fi

# If we have a copyright-checking script, run it
if test -x ./contrib/update-my-copyright.pl; then
   echo "=== Checking copyrights..."
   ./contrib/update-my-copyright.pl --check-only --quiet || die $? "Copyrights are not up to date"
else
   echo "=== No update-my-copyright.pl script -- skipping"
fi