editor input from the user.
nestedTag::
Advice shown if a user attempts to recursively tag a tag object.
+ submoduleAlternateErrorStrategyDie:
+ Advice shown when a submodule.alternateErrorStrategy option
+ configured to "die" causes a fatal error.
--
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] = {
{ "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 }
extern int advice_graft_file_deprecated;
extern int advice_checkout_ambiguous_remote_branch_name;
extern int advice_nested_tag;
+extern int advice_submodule_alternate_error_strategy_die;
int git_default_advice_config(const char *var, const char *value);
__attribute__((format (printf, 1, 2)))
#include "diffcore.h"
#include "diff.h"
#include "object-store.h"
+#include "advice.h"
#define OPT_QUIET (1 << 0)
#define OPT_CACHED (1 << 1)
#define SUBMODULE_ALTERNATE_SETUP_INIT { NULL, \
SUBMODULE_ALTERNATE_ERROR_IGNORE, NULL }
+static const char alternate_error_advice[] = N_(
+"An alternate computed from a superproject's alternate is invalid.\n"
+"To allow Git to clone without an alternate in such a case, set\n"
+"submodule.alternateErrorStrategy to 'info' or, equivalently, clone with\n"
+"'--reference-if-able' instead of '--reference'."
+);
+
static int add_possible_reference_from_superproject(
struct object_directory *odb, void *sas_cb)
{
} else {
switch (sas->error_mode) {
case SUBMODULE_ALTERNATE_ERROR_DIE:
+ if (advice_submodule_alternate_error_strategy_die)
+ advise(_(alternate_error_advice));
die(_("submodule '%s' cannot add alternate: %s"),
sas->submodule_name, err.buf);
case SUBMODULE_ALTERNATE_ERROR_INFO: