From f779fd1f8fbebe6d32feee619c0430ca142b9a6d Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 3 May 2024 17:44:49 +0200 Subject: [PATCH] meson: Set up git submodule update on post checkout as well --- docs/HACKING.md | 3 ++- tools/git-setup.sh | 8 +++++++- ...-post-rewrite-hook.sh => git-submodule-update-hook.sh} | 0 3 files changed, 9 insertions(+), 2 deletions(-) rename tools/{git-post-rewrite-hook.sh => git-submodule-update-hook.sh} (100%) diff --git a/docs/HACKING.md b/docs/HACKING.md index 9e25ceec33..980a45929e 100644 --- a/docs/HACKING.md +++ b/docs/HACKING.md @@ -27,7 +27,8 @@ $ git config submodule.recurse true $ git config fetch.recurseSubmodules on-demand $ git config push.recurseSubmodules no $ cp .git/hooks/pre-commit.sample .git/hooks/pre-commit -$ cp tools/git-post-rewrite-hook.sh .git/hooks/post-rewrite +$ cp tools/git-submodule-update-hook.sh .git/hooks/post-rewrite +$ cp tools/git-submodule-update-hook.sh .git/hooks/post-checkout ``` Please always test your work before submitting a PR. diff --git a/tools/git-setup.sh b/tools/git-setup.sh index a53f1790c1..8cc1bfdfc2 100755 --- a/tools/git-setup.sh +++ b/tools/git-setup.sh @@ -20,9 +20,15 @@ if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then fi if [ ! -f .git/hooks/post-rewrite ]; then - cp -p tools/git-post-rewrite-hook.sh .git/hooks/post-rewrite + cp -p tools/git-submodule-update-hook.sh .git/hooks/post-rewrite echo 'Activated post-rewrite hook' ret=0 fi +if [ ! -f .git/hooks/post-checkout ]; then + cp -p tools/git-submodule-update-hook.sh .git/hooks/post-checkout + echo 'Activated post-checkout hook' + ret=0 +fi + exit $ret diff --git a/tools/git-post-rewrite-hook.sh b/tools/git-submodule-update-hook.sh similarity index 100% rename from tools/git-post-rewrite-hook.sh rename to tools/git-submodule-update-hook.sh