aboutsummaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorHeiko Voigt <hvoigt@hvoigt.net>2011-08-11 19:51:46 +0200
committerJunio C Hamano <gitster@pobox.com>2011-08-11 12:27:30 -0700
commit322bb6e12f713900dcac7cac59c00a167f70f2c3 (patch)
tree36597f613f2d7cdcbf1825e3415d8b3f1a024654 /git-submodule.sh
parent817bac35f24166e8b306ecef5283ed721068f113 (diff)
downloadgit-322bb6e12f713900dcac7cac59c00a167f70f2c3.tar.gz
git-322bb6e12f713900dcac7cac59c00a167f70f2c3.tar.xz
add update 'none' flag to disable update of submodule by default
This is useful to mark a submodule as unneeded by default. When this option is set and the user wants to work with such a submodule he needs to configure 'submodule.<name>.update=checkout' or pass the --checkout option. Then the submodule can be handled like a normal submodule. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index e544dbc91..34d2be6ef 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -429,6 +429,9 @@ cmd_update()
--recursive)
recursive=1
;;
+ --checkout)
+ update="checkout"
+ ;;
--)
shift
break
@@ -468,6 +471,12 @@ cmd_update()
update_module=$(git config submodule."$name".update)
fi
+ if test "$update_module" = "none"
+ then
+ echo "Skipping submodule '$path'"
+ continue
+ fi
+
if test -z "$url"
then
# Only mention uninitialized submodules when its