Skip to content

Commit bba0fd2

Browse files
committed
push: do not give big warning when no preference is configured
If the message said "we will be changing the default in the future, so this is to warn people who want to keep the current default what to do", it would have made some sense, but as it stands, the message is merely an unsolicited advertisement for a new feature, which it is not helpful at all. Squelch it. Signed-off-by: Junio C Hamano <[email protected]>
1 parent d5cee0f commit bba0fd2

File tree

3 files changed

+2
-28
lines changed

3 files changed

+2
-28
lines changed

builtin-push.c

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -64,36 +64,11 @@ static void setup_push_tracking(void)
6464
add_refspec(refspec.buf);
6565
}
6666

67-
static const char *warn_unconfigured_push_msg[] = {
68-
"You did not specify any refspecs to push, and the current remote",
69-
"has not configured any push refspecs. The default action in this",
70-
"case is to push all matching refspecs, that is, all branches",
71-
"that exist both locally and remotely will be updated. This may",
72-
"not necessarily be what you want to happen.",
73-
"",
74-
"You can specify what action you want to take in this case, and",
75-
"avoid seeing this message again, by configuring 'push.default' to:",
76-
" 'nothing' : Do not push anything",
77-
" 'matching' : Push all matching branches (default)",
78-
" 'tracking' : Push the current branch to whatever it is tracking",
79-
" 'current' : Push the current branch"
80-
};
81-
82-
static void warn_unconfigured_push(void)
83-
{
84-
int i;
85-
for (i = 0; i < ARRAY_SIZE(warn_unconfigured_push_msg); i++)
86-
warning("%s", warn_unconfigured_push_msg[i]);
87-
}
88-
8967
static void setup_default_push_refspecs(void)
9068
{
9169
git_config(git_default_config, NULL);
9270
switch (push_default) {
93-
case PUSH_DEFAULT_UNSPECIFIED:
94-
warn_unconfigured_push();
95-
/* fallthrough */
96-
71+
default:
9772
case PUSH_DEFAULT_MATCHING:
9873
add_refspec(":");
9974
break;

cache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,6 @@ enum rebase_setup_type {
543543
};
544544

545545
enum push_default_type {
546-
PUSH_DEFAULT_UNSPECIFIED = -1,
547546
PUSH_DEFAULT_NOTHING = 0,
548547
PUSH_DEFAULT_MATCHING,
549548
PUSH_DEFAULT_TRACKING,

environment.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ enum safe_crlf safe_crlf = SAFE_CRLF_WARN;
4242
unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;
4343
enum branch_track git_branch_track = BRANCH_TRACK_REMOTE;
4444
enum rebase_setup_type autorebase = AUTOREBASE_NEVER;
45-
enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED;
45+
enum push_default_type push_default = PUSH_DEFAULT_MATCHING;
4646
#ifndef OBJECT_CREATION_MODE
4747
#define OBJECT_CREATION_MODE OBJECT_CREATION_USES_HARDLINKS
4848
#endif

0 commit comments

Comments
 (0)