From f8d1befdfff165af9a0a216b72f039abe11e3385 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 19 Jul 2021 16:31:22 -0500 Subject: [PATCH] autogen.sh: leave .git/hooks/pre-{commit,push} alone unless they don't exist, to allow for local ecosystem-dependent customizations of the hooks. --- autogen.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh index aba57d715..1dc3ba1fb 100755 --- a/autogen.sh +++ b/autogen.sh @@ -8,8 +8,12 @@ if test -d .git; then if ! test -d .git/hooks; then mkdir .git/hooks fi - ln -s -f ../../pre-commit.sh .git/hooks/pre-commit - ln -s -f ../../pre-push.sh .git/hooks/pre-push + if [ ! -e .git/hooks/pre-commit ]; then + ln -s ../../pre-commit.sh .git/hooks/pre-commit + fi + if [ ! -e .git/hooks/pre-push ]; then + ln -s ../../pre-push.sh .git/hooks/pre-push + fi fi # touch options.h (make sure it exists)