summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2016-05-26 14:59:43 -0700
committerJunio C Hamano <gitster@pobox.com>2016-05-27 10:40:46 -0700
commitabed000acafd8aa86e02bcbb65fc1a8e4f06b8a0 (patch)
treededda0e06c5bcf2af6a694fffba498f0fa7607bd /git-submodule.sh
parent37f52e93441e1da00c9c9824ed03cd074d77f43a (diff)
downloadgit-abed000acafd8aa86e02bcbb65fc1a8e4f06b8a0.tar.gz
submodule update: learn `--[no-]recommend-shallow` option
Sometimes the history of a submodule is not considered important by the projects upstream. To make it easier for downstream users, allow a boolean field 'submodule.<name>.shallow' in .gitmodules, which can be used to recommend whether upstream considers the history important. This field is honored in the initial clone by default, it can be ignored by giving the `--no-recommend-shallow` option. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 5a4dec050b..42e0e9f63d 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>...]"
@@ -559,6 +559,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"
@@ -601,6 +607,7 @@ cmd_update()
${update:+--update "$update"} \
${reference:+--reference "$reference"} \
${depth:+--depth "$depth"} \
+ ${recommend_shallow:+"$recommend_shallow"} \
${jobs:+$jobs} \
"$@" || echo "#unmatched"
} | {