Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-05-30 08:04:09 +0300
committerJunio C Hamano <gitster@pobox.com>2018-05-30 08:04:09 +0300
commit2a98a8794eac7089d4e44f51b19e358a14eb6d3e (patch)
treebcd3161145577f27c0b66e332b843ebfd52bff9f /git-submodule.sh
parent4ce72180abe72dbb40f5e6a517deea814014e005 (diff)
parenta0ef29341accafa51345e90225d87f6a0d297b7b (diff)
Merge branch 'cf/submodule-progress-dissociate'
"git submodule update" and "git submodule add" supported the "--reference" option to borrow objects from a neighbouring local repository like "git clone" does, but lacked the more recent invention "--dissociate". Also "git submodule add" has been taught to take the "--progress" option. * cf/submodule-progress-dissociate: submodule: add --dissociate option to add/update commands submodule: add --progress option to add command submodule: clean up substitutions in script
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh21
1 files changed, 16 insertions, 5 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 7e27d0a0da..fd0fe081a8 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -42,6 +42,7 @@ prefix=
custom_name=
depth=
progress=
+dissociate=
die_if_unmatched ()
{
@@ -117,6 +118,9 @@ cmd_add()
-q|--quiet)
GIT_QUIET=1
;;
+ --progress)
+ progress=1
+ ;;
--reference)
case "$2" in '') usage ;; esac
reference_path=$2
@@ -125,6 +129,9 @@ cmd_add()
--reference=*)
reference_path="${1#--reference=}"
;;
+ --dissociate)
+ dissociate=1
+ ;;
--name)
case "$2" in '') usage ;; esac
custom_name=$2
@@ -260,7 +267,7 @@ or you are unsure what this means choose another name with the '--name' option."
eval_gettextln "Reactivating local git directory for submodule '\$sm_name'."
fi
fi
- git submodule--helper clone ${GIT_QUIET:+--quiet} --prefix "$wt_prefix" --path "$sm_path" --name "$sm_name" --url "$realrepo" ${reference:+"$reference"} ${depth:+"$depth"} || exit
+ git submodule--helper clone ${GIT_QUIET:+--quiet} ${progress:+"--progress"} --prefix "$wt_prefix" --path "$sm_path" --name "$sm_name" --url "$realrepo" ${reference:+"$reference"} ${dissociate:+"--dissociate"} ${depth:+"$depth"} || exit
(
sanitize_submodule_env
cd "$sm_path" &&
@@ -470,7 +477,7 @@ cmd_update()
GIT_QUIET=1
;;
--progress)
- progress="--progress"
+ progress=1
;;
-i|--init)
init=1
@@ -495,6 +502,9 @@ cmd_update()
--reference=*)
reference="$1"
;;
+ --dissociate)
+ dissociate=1
+ ;;
-m|--merge)
update="merge"
;;
@@ -547,14 +557,15 @@ cmd_update()
{
git submodule--helper update-clone ${GIT_QUIET:+--quiet} \
- ${progress:+"$progress"} \
+ ${progress:+"--progress"} \
${wt_prefix:+--prefix "$wt_prefix"} \
${prefix:+--recursive-prefix "$prefix"} \
${update:+--update "$update"} \
${reference:+"$reference"} \
+ ${dissociate:+"--dissociate"} \
${depth:+--depth "$depth"} \
- ${recommend_shallow:+"$recommend_shallow"} \
- ${jobs:+$jobs} \
+ $recommend_shallow \
+ $jobs \
"$@" || echo "#unmatched" $?
} | {
err=