From be4d2c83b68a96285cc05036add4d64d324e52d9 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 16 May 2008 11:23:03 +0100 Subject: submodule update: add convenience option --init When a submodule is not initialized and you do not want to change the defaults from .gitmodules anyway, you can now say $ git submodule update --init When "update" is called without --init on an uninitialized submodule, a hint to use --init is printed. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- git-submodule.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'git-submodule.sh') diff --git a/git-submodule.sh b/git-submodule.sh index b4b7d28d9d..100737210d 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -5,7 +5,7 @@ # Copyright (c) 2007 Lars Hjemli USAGE="[--quiet] [--cached] \ -[add [-b branch]|status|init|update|summary [-n|--summary-limit ] []] \ +[add [-b branch]|status|init|update [-i|--init]|summary [-n|--summary-limit ] []] \ [--] [...]" OPTIONS_SPEC= . git-sh-setup @@ -271,6 +271,10 @@ cmd_update() -q|--quiet) quiet=1 ;; + -i|--init) + shift + cmd_init "$@" || return + ;; --) shift break @@ -296,6 +300,7 @@ cmd_update() # path have been specified test "$#" != "0" && say "Submodule path '$path' not initialized" + say "Maybe you want to use 'update --init'?" continue fi -- cgit v1.2.1