Merge branch 'mm/push-default-warning'
authorJunio C Hamano <gitster@pobox.com>
Fri, 26 Feb 2016 21:37:25 +0000 (13:37 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 26 Feb 2016 21:37:25 +0000 (13:37 -0800)
Across the transition at around Git version 2.0, the user used to
get a pretty loud warning when running "git push" without setting
push.default configuration variable. We no longer warn, given that
the transition is over long time ago.

* mm/push-default-warning:
push: remove "push.default is unset" warning message

1  2 
builtin/push.c
diff --combined builtin/push.c
index 6e13b3c90a08ade04aa7f84b2f3a3c869c0288bd,270db40196cfc1e92a2650aedae5b792819bb959..4e9e4dbab23e5fb78239eadde724a63240e43505
@@@ -23,7 -23,6 +23,7 @@@ static const char *receivepack
  static int verbosity;
  static int progress = -1;
  static int recurse_submodules = RECURSE_SUBMODULES_DEFAULT;
 +static enum transport_family family;
  
  static struct push_cas_option cas;
  
@@@ -205,37 -204,6 +205,6 @@@ static void setup_push_current(struct r
        add_refspec(branch->name);
  }
  
- static char warn_unspecified_push_default_msg[] =
- N_("push.default is unset; its implicit value has changed in\n"
-    "Git 2.0 from 'matching' to 'simple'. To squelch this message\n"
-    "and maintain the traditional behavior, use:\n"
-    "\n"
-    "  git config --global push.default matching\n"
-    "\n"
-    "To squelch this message and adopt the new behavior now, use:\n"
-    "\n"
-    "  git config --global push.default simple\n"
-    "\n"
-    "When push.default is set to 'matching', git will push local branches\n"
-    "to the remote branches that already exist with the same name.\n"
-    "\n"
-    "Since Git 2.0, Git defaults to the more conservative 'simple'\n"
-    "behavior, which only pushes the current branch to the corresponding\n"
-    "remote branch that 'git pull' uses to update the current branch.\n"
-    "\n"
-    "See 'git help config' and search for 'push.default' for further information.\n"
-    "(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode\n"
-    "'current' instead of 'simple' if you sometimes use older versions of Git)");
- static void warn_unspecified_push_default_configuration(void)
- {
-       static int warn_once;
-       if (warn_once++)
-               return;
-       warning("%s\n", _(warn_unspecified_push_default_msg));
- }
  static int is_workflow_triangular(struct remote *remote)
  {
        struct remote *fetch_remote = remote_get(NULL);
@@@ -254,9 -222,6 +223,6 @@@ static void setup_default_push_refspecs
                break;
  
        case PUSH_DEFAULT_UNSPECIFIED:
-               warn_unspecified_push_default_configuration();
-               /* fallthru */
        case PUSH_DEFAULT_SIMPLE:
                if (triangular)
                        setup_push_current(remote, branch);
@@@ -347,7 -312,6 +313,7 @@@ static int push_with_options(struct tra
        unsigned int reject_reasons;
  
        transport_set_verbosity(transport, verbosity, progress);
 +      transport->family = family;
  
        if (receivepack)
                transport_set_option(transport,
@@@ -567,10 -531,6 +533,10 @@@ int cmd_push(int argc, const char **arg
                  0, "signed", &push_cert, "yes|no|if-asked", N_("GPG sign the push"),
                  PARSE_OPT_OPTARG, option_parse_push_signed },
                OPT_BIT(0, "atomic", &flags, N_("request atomic transaction on remote side"), TRANSPORT_PUSH_ATOMIC),
 +              OPT_SET_INT('4', "ipv4", &family, N_("use IPv4 addresses only"),
 +                              TRANSPORT_FAMILY_IPV4),
 +              OPT_SET_INT('6', "ipv6", &family, N_("use IPv6 addresses only"),
 +                              TRANSPORT_FAMILY_IPV6),
                OPT_END()
        };