summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-06-20 11:01:01 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-06-20 11:01:01 -0700
commit3807098cd6abf4b94b6e0326255e5f5f0577f975 (patch)
tree34d2bb8e5c9ae4f9409c2cfdd6206ec32a5ff5d0 /git-submodule.sh
parentMerge branch 'sb/submodule-misc-cleanups' (diff)
parentsubmodule update: learn `--[no-]recommend-shallow` option (diff)
downloadtgif-3807098cd6abf4b94b6e0326255e5f5f0577f975.tar.xz
Merge branch 'sb/submodule-recommend-shallowness'
An upstream project can make a recommendation to shallowly clone some submodules in the .gitmodules file it ships. * sb/submodule-recommend-shallowness: submodule update: learn `--[no-]recommend-shallow` option submodule-config: keep shallow recommendation around
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 128f22ffb8..b39ac106ec 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -9,7 +9,7 @@ USAGE="[--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <re
or: $dashless [--quiet] status [--cached] [--recursive] [--] [<path>...]
or: $dashless [--quiet] init [--] [<path>...]
or: $dashless [--quiet] deinit [-f|--force] (--all| [--] <path>...)
- or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--reference <repository>] [--recursive] [--] [<path>...]
+ or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--] [<path>...]
or: $dashless [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
or: $dashless [--quiet] foreach [--recursive] <command>
or: $dashless [--quiet] sync [--recursive] [--] [<path>...]"
@@ -530,6 +530,12 @@ cmd_update()
--checkout)
update="checkout"
;;
+ --recommend-shallow)
+ recommend_shallow="--recommend-shallow"
+ ;;
+ --no-recommend-shallow)
+ recommend_shallow="--no-recommend-shallow"
+ ;;
--depth)
case "$2" in '') usage ;; esac
depth="--depth=$2"
@@ -572,6 +578,7 @@ cmd_update()
${update:+--update "$update"} \
${reference:+--reference "$reference"} \
${depth:+--depth "$depth"} \
+ ${recommend_shallow:+"$recommend_shallow"} \
${jobs:+$jobs} \
"$@" || echo "#unmatched"
} | {