mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 23:53:32 +01:00
Add post-merge git hook to warn about git hooks being updated in the repo
This commit is contained in:
parent
911f95ed92
commit
2d3ef34dce
24
scripts/maint/post-merge.git-hook
Executable file
24
scripts/maint/post-merge.git-hook
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
git_toplevel=$(git rev-parse --show-toplevel)
|
||||||
|
|
||||||
|
check_for_diffs() {
|
||||||
|
installed="$git_toplevel/.git/hooks/$1"
|
||||||
|
latest="$git_toplevel/scripts/maint/$1.git-hook"
|
||||||
|
|
||||||
|
if [ -e "$installed" ]
|
||||||
|
then
|
||||||
|
if ! cmp "$installed" "$latest" >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
echo "ATTENTION: $1 hook has changed:"
|
||||||
|
echo "==============================="
|
||||||
|
diff "$installed" "$latest"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_for_diffs "pre-push"
|
||||||
|
check_for_diffs "pre-commit"
|
||||||
|
check_for_diffs "post-merge"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user