File: checkpatch-git-post-commit-hook

package info (click to toggle)
network-manager 1.56.0-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 71,620 kB
  • sloc: ansic: 486,421; python: 11,618; xml: 8,551; sh: 5,442; perl: 596; cpp: 178; javascript: 130; ruby: 107; makefile: 64; lisp: 22
file content (23 lines) | stat: -rwxr-xr-x 447 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

# contrib/scripts/checkpatch-git-post-commit-hook:
#   Call this script via ".git/hooks/post-commit"

DISABLED=${NM_HOOK_DISABLED:0}

if [ "$DISABLED" == 1 ]; then
    echo "COMMIT HOOK DISABLED"
    exit 0
fi

FILE=contrib/scripts/checkpatch-feature-branch.sh
if [ -x "$FILE" ]; then
    "$FILE"
    exit 0
fi

FILE=contrib/scripts/checkpatch.pl
if [ -x "$FILE" ]; then
    git format-patch -U65535 --stdout -1 | "$FILE"
    exit 0
fi