summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorChris Packham <judge.packham@gmail.com>2013-07-03 09:02:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-07-03 17:15:15 (GMT)
commit6cb5728c43f34a7348e128b44b80d00b9417cb19 (patch)
tree137cbeae5b61afee929c2674f6088a48748af1f8 /git-submodule.sh
parentd9857bfd4de097d662d40481664ef30577f120f5 (diff)
downloadgit-6cb5728c43f34a7348e128b44b80d00b9417cb19.zip
git-6cb5728c43f34a7348e128b44b80d00b9417cb19.tar.gz
git-6cb5728c43f34a7348e128b44b80d00b9417cb19.tar.bz2
submodule update: allow custom command to update submodule working tree
Users can set submodule.$name.update to '!command' which will cause 'command' to be run instead of checkout/merge/rebase. This allows the user finer-grained control over how the update is done. The primary motivation for this was interoperability with stgit; however being able to intercept the submodule update process may prove useful for integrating with or extending other tools. Signed-off-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 945e296..c87515d 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -860,6 +860,12 @@ Maybe you want to use 'update --init'?")"
say_msg="$(eval_gettext "Submodule path '\$displaypath': merged in '\$sha1'")"
must_die_on_failure=yes
;;
+ !*)
+ command="${update_module#!}"
+ die_msg="$(eval_gettext "Execution of '\$command \$sha1' failed in submodule path '\$prefix\$sm_path'")"
+ say_msg="$(eval_gettext "Submodule path '\$prefix\$sm_path': '\$command \$sha1'")"
+ must_die_on_failure=yes
+ ;;
*)
command="git checkout $subforce -q"
die_msg="$(eval_gettext "Unable to checkout '\$sha1' in submodule path '\$displaypath'")"