summaryrefslogtreecommitdiff
path: root/advice.c
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2019-12-02 19:57:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-12-03 16:49:45 (GMT)
commit4f3e57ef13d0ad4c00d0a87f0858cde81456a2e0 (patch)
treecb86a3bd9dcb28f554950037e5f8f10acac393bf /advice.c
parent10c64a0b3c15391180c31d1217ba01d687558757 (diff)
downloadgit-4f3e57ef13d0ad4c00d0a87f0858cde81456a2e0.zip
git-4f3e57ef13d0ad4c00d0a87f0858cde81456a2e0.tar.gz
git-4f3e57ef13d0ad4c00d0a87f0858cde81456a2e0.tar.bz2
submodule--helper: advise on fatal alternate error
When recursively cloning a superproject with some shallow modules defined in its .gitmodules, then recloning with "--reference=<path>", an error occurs. For example: git clone --recurse-submodules --branch=master -j8 \ https://android.googlesource.com/platform/superproject \ master git clone --recurse-submodules --branch=master -j8 \ https://android.googlesource.com/platform/superproject \ --reference master master2 fails with: fatal: submodule '<snip>' cannot add alternate: reference repository '<snip>' is shallow When a alternate computed from the superproject's alternate cannot be added, whether in this case or another, advise about configuring the "submodule.alternateErrorStrategy" configuration option and using "--reference-if-able" instead of "--reference" when cloning. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'advice.c')
-rw-r--r--advice.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/advice.c b/advice.c
index 3ee0ee2..249c60d 100644
--- a/advice.c
+++ b/advice.c
@@ -30,6 +30,7 @@ int advice_waiting_for_editor = 1;
int advice_graft_file_deprecated = 1;
int advice_checkout_ambiguous_remote_branch_name = 1;
int advice_nested_tag = 1;
+int advice_submodule_alternate_error_strategy_die = 1;
static int advice_use_color = -1;
static char advice_colors[][COLOR_MAXLEN] = {
@@ -89,6 +90,7 @@ static struct {
{ "graftFileDeprecated", &advice_graft_file_deprecated },
{ "checkoutAmbiguousRemoteBranchName", &advice_checkout_ambiguous_remote_branch_name },
{ "nestedTag", &advice_nested_tag },
+ { "submoduleAlternateErrorStrategyDie", &advice_submodule_alternate_error_strategy_die },
/* make this an alias for backward compatibility */
{ "pushNonFastForward", &advice_push_update_rejected }