aboutsummaryrefslogtreecommitdiffstats
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2016-02-29 18:07:19 -0800
committerJunio C Hamano <gitster@pobox.com>2016-03-01 11:57:20 -0800
commit2335b870fa7942d9ca9e73e96e35171fda741376 (patch)
treef76c7f7b8fcd2d4bcac7ec1f57f53eb079c2b1c0 /git-submodule.sh
parentcdc04b65b4bc8094e082ac65a7dce75a7a990163 (diff)
downloadgit-2335b870fa7942d9ca9e73e96e35171fda741376.tar.gz
submodule update: expose parallelism to the user
Expose possible parallelism either via the "--jobs" CLI parameter or the "submodule.fetchJobs" setting. By having the variable initialized to -1, we make sure 0 can be passed into the parallel processing machine, which will then pick as many parallel workers as there are CPUs. Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> 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, 9 insertions, 0 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index a6a82d25aa..86018ee9c5 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -645,6 +645,14 @@ cmd_update()
--depth=*)
depth=$1
;;
+ -j|--jobs)
+ case "$2" in '') usage ;; esac
+ jobs="--jobs=$2"
+ shift
+ ;;
+ --jobs=*)
+ jobs=$1
+ ;;
--)
shift
break
@@ -671,6 +679,7 @@ cmd_update()
${update:+--update "$update"} \
${reference:+--reference "$reference"} \
${depth:+--depth "$depth"} \
+ ${jobs:+$jobs} \
"$@" || echo "#unmatched"
} | {
err=