diff options
-rwxr-xr-x | tools/pre-commit | 8 | ||||
-rw-r--r-- | tools/pre-commit-checkignore.txt | 11 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tools/pre-commit b/tools/pre-commit index e83971902e..bfc8aedeaa 100755 --- a/tools/pre-commit +++ b/tools/pre-commit @@ -27,6 +27,9 @@ hook_script=${GIT_DIR:-.git}/hooks/pre-commit # invocations via relative paths (such as ../tools/pre-commit): cd "$(git rev-parse --show-toplevel)" +# Path to excluded files listing +excludes=./tools/pre-commit-checkignore.txt + # Check for newer (actually, different) versions of the pre-commit script # (but only if invoked as hook, i.e. the commit ID is not given as argument). if [ -z "$1" ] && ! cmp -s "$hook_script" tools/pre-commit; then @@ -37,6 +40,11 @@ exit_status=0 for FILE in `git diff-index --cached --name-status ${COMMIT_ID} | grep -v "^D" | cut -f2 | grep "\.[ch]$" | grep -v "extcap/"` ; do + #Skip if listed + if [ -e $excludes ] && grep -Fxq "$FILE" "$excludes"; then + continue + fi + #Check if checkhf is good ./tools/checkhf.pl $FILE || exit_status=1 diff --git a/tools/pre-commit-checkignore.txt b/tools/pre-commit-checkignore.txt new file mode 100644 index 0000000000..d7598f4c9d --- /dev/null +++ b/tools/pre-commit-checkignore.txt @@ -0,0 +1,11 @@ +# Files listed here are ignored by the git pre-commit hook for the +# purpose of checking for forbidden APIs and other dissector-specific +# glitches. +# +# Each line must match a single file using the full path, exactly as +# return by 'git diff-index --name-only', e.g.: +# +#tools/pre-commit-checkignore.txt +# + +tools/lemon/lemon.c |