Add git hooks to call in-project git hooks as well

This commit is contained in:
Talia 2021-02-08 13:36:02 +01:00
parent b535c134a5
commit 36a376a323
12 changed files with 85 additions and 0 deletions

8
githooks/applypatch-msg Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
hook=$(basename $0)
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook
fi

7
githooks/commit-msg Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
hook=$(basename $0)
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook
fi

7
githooks/fsmonitor-watchman Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
hook=$(basename $0)
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook
fi

7
githooks/post-checkout Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
hook=$(basename $0)
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook
fi

7
githooks/post-update Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
hook=$(basename $0)
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook
fi

7
githooks/pre-applypatch Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
hook=$(basename $0)
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook
fi

View file

@ -51,3 +51,10 @@ if [ -z "$error" ]
then exit 0 then exit 0
else exit 1 else exit 1
fi fi
hook=$(basename $0)
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook
fi

7
githooks/pre-push Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
hook=$(basename $0)
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook
fi

7
githooks/pre-rebase Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
hook=$(basename $0)
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook
fi

7
githooks/pre-receive Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
hook=$(basename $0)
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook
fi

7
githooks/prepare-commit-msg Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
hook=$(basename $0)
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook
fi

7
githooks/update Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
hook=$(basename $0)
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook
fi