From: Antonio Ospite Date: Mon, 17 Dec 2018 09:16:38 +0000 (+0100) Subject: Add submodule-update-foreach.sh and a post-pull hook for it X-Git-Url: https://git.ao2.it/config/vcsh.git/commitdiff_plain/0a50375aa4ea1d908e024e2ed8706a4c64670600 Add submodule-update-foreach.sh and a post-pull hook for it Update submodules also after a "vcsh pull" command. This requires a whole new script because vcsh does not call post-pull hooks after pulling each repositories, it only calls the hook once after pulling all of them. See https://github.com/RichiH/vcsh/issues/213 When the issue gets fixed submodule-update-foreach.sh can be removed and post-pull.00-submodule-init can link to submodule-update.sh --- diff --git a/.config/vcsh/hooks-available/submodule-update-foreach.sh b/.config/vcsh/hooks-available/submodule-update-foreach.sh new file mode 100755 index 0000000..3405942 --- /dev/null +++ b/.config/vcsh/hooks-available/submodule-update-foreach.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +: "${XDG_CONFIG_HOME:="$HOME/.config"}" + +# XXX This should really be a normal post-pull hook, but vcsh lacks +# per-repository pull/push hooks, see +# https://github.com/RichiH/vcsh/issues/213 + +echo "Updating submodules..." +vcsh foreach -g "$XDG_CONFIG_HOME/vcsh/hooks-available/submodule-update.sh" diff --git a/.config/vcsh/hooks-enabled/post-pull.00-submodule-init b/.config/vcsh/hooks-enabled/post-pull.00-submodule-init new file mode 120000 index 0000000..5ebe104 --- /dev/null +++ b/.config/vcsh/hooks-enabled/post-pull.00-submodule-init @@ -0,0 +1 @@ +../hooks-available/submodule-update-foreach.sh \ No newline at end of file