3 # To install this script, copy it to .git/hooks/pre-commit in local copy of
4 # tor git repo and make sure it has permission to execute.
6 # This is pre-commit git hook script that prevents commiting your changeset if
7 # it fails our code formatting or changelog entry formatting checkers.
9 workdir
=$
(git rev-parse
--show-toplevel)
11 cd "$workdir" ||
exit 1
15 if [ ! -z "ls ./changes/*" ]; then
16 python
scripts
/maint
/lintChanges.py .
/changes
/*
19 if [ -d src
/lib
]; then
20 # This is the layout in 0.3.5
21 perl
scripts
/maint
/checkSpace.pl
-C \
24 src
/feature
/*/*.
[ch
] \
29 elif [ -d src
/common
]; then
30 # This was the layout before 0.3.5
31 perl
scripts
/maint
/checkSpace.pl
-C \
39 if test -e scripts
/maint
/checkIncludes.py
; then
40 python
scripts
/maint
/checkIncludes.py