mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-21 02:04:17 +00:00
contrib/scripts: add "checkpatch-git-post-commit-hook" script to contrib/
This can be used as git post-commit hook.
This commit is contained in:
parent
2b0689b9ae
commit
1bc5a7c778
23
contrib/scripts/checkpatch-git-post-commit-hook
Executable file
23
contrib/scripts/checkpatch-git-post-commit-hook
Executable file
|
@ -0,0 +1,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
|
Loading…
Reference in a new issue