]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Set up git submodule update on post checkout as well
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 3 May 2024 15:44:49 +0000 (17:44 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 5 May 2024 12:49:21 +0000 (14:49 +0200)
docs/HACKING.md
tools/git-setup.sh
tools/git-submodule-update-hook.sh [moved from tools/git-post-rewrite-hook.sh with 100% similarity]

index 9e25ceec33fee4318ad63a993330f509826e1811..980a45929eb8653f8b8578c739fadce26ad7d264 100644 (file)
@@ -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.
index a53f1790c17a7ae2d2a233a3d351abbc732d7762..8cc1bfdfc2a47a6eb85d30b2a5bab40491dcfc5a 100755 (executable)
@@ -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