Skip to content

Commit 15be621

Browse files
committed
Merge branch 'mm/push-default-warning'
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
2 parents 4ce064d + 2f27520 commit 15be621

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

builtin/push.c

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -205,37 +205,6 @@ static void setup_push_current(struct remote *remote, struct branch *branch)
205205
add_refspec(branch->name);
206206
}
207207

208-
static char warn_unspecified_push_default_msg[] =
209-
N_("push.default is unset; its implicit value has changed in\n"
210-
"Git 2.0 from 'matching' to 'simple'. To squelch this message\n"
211-
"and maintain the traditional behavior, use:\n"
212-
"\n"
213-
" git config --global push.default matching\n"
214-
"\n"
215-
"To squelch this message and adopt the new behavior now, use:\n"
216-
"\n"
217-
" git config --global push.default simple\n"
218-
"\n"
219-
"When push.default is set to 'matching', git will push local branches\n"
220-
"to the remote branches that already exist with the same name.\n"
221-
"\n"
222-
"Since Git 2.0, Git defaults to the more conservative 'simple'\n"
223-
"behavior, which only pushes the current branch to the corresponding\n"
224-
"remote branch that 'git pull' uses to update the current branch.\n"
225-
"\n"
226-
"See 'git help config' and search for 'push.default' for further information.\n"
227-
"(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode\n"
228-
"'current' instead of 'simple' if you sometimes use older versions of Git)");
229-
230-
static void warn_unspecified_push_default_configuration(void)
231-
{
232-
static int warn_once;
233-
234-
if (warn_once++)
235-
return;
236-
warning("%s\n", _(warn_unspecified_push_default_msg));
237-
}
238-
239208
static int is_workflow_triangular(struct remote *remote)
240209
{
241210
struct remote *fetch_remote = remote_get(NULL);
@@ -254,9 +223,6 @@ static void setup_default_push_refspecs(struct remote *remote)
254223
break;
255224

256225
case PUSH_DEFAULT_UNSPECIFIED:
257-
warn_unspecified_push_default_configuration();
258-
/* fallthru */
259-
260226
case PUSH_DEFAULT_SIMPLE:
261227
if (triangular)
262228
setup_push_current(remote, branch);

0 commit comments

Comments
 (0)