From 0a50375aa4ea1d908e024e2ed8706a4c64670600 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Mon, 17 Dec 2018 10:16:38 +0100 Subject: [PATCH] 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 --- .config/vcsh/hooks-available/submodule-update-foreach.sh | 12 ++++++++++++ .config/vcsh/hooks-enabled/post-pull.00-submodule-init | 1 + 2 files changed, 13 insertions(+) create mode 100755 .config/vcsh/hooks-available/submodule-update-foreach.sh create mode 120000 .config/vcsh/hooks-enabled/post-pull.00-submodule-init 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 -- 2.1.4