3 # This is post-merge git hook script to check for changes in:
5 # * helper scripts for using git efficiently.
6 # If any changes are detected, a diff of them is printed.
8 # To install this script, copy it to .git/hooks/post-merge in local copy of
9 # tor git repo and make sure it has permission to execute.
11 git_toplevel
=$
(git rev-parse
--show-toplevel)
14 installed
="$git_toplevel/.git/hooks/$1"
15 latest
="$git_toplevel/scripts/maint/$1.git-hook"
17 if [ -e "$installed" ]
19 if ! cmp "$installed" "$latest" >/dev
/null
2>&1
21 echo "ATTENTION: $1 hook has changed:"
22 echo "==============================="
23 diff "$installed" "$latest"
28 check_for_script_update
() {
29 fullpath
="$git_toplevel/scripts/maint/$1"
31 if ! git
diff ORIG_HEAD HEAD
--exit-code -- "$fullpath" >/dev
/null
33 echo "ATTENTION: $1 has changed:"
34 git
diff ORIG_HEAD HEAD
-- "$fullpath"
38 check_for_diffs
"pre-push"
39 check_for_diffs
"pre-commit"
40 check_for_diffs
"post-merge"
42 check_for_script_update
"git-merge-forward.sh"
43 check_for_script_update
"git-pull-all.sh"
44 check_for_script_update
"git-push-all.sh"