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 <gitster@pobox.com>
Junio C Hamano committed
Jul 18, 2009 at 17:19 UTC
bba0fd22ad654460a81c4b35462b600d9432a869
3 files changed
+2
-28
builtin-push.c
+1
-26
@@ -64,36 +64,11 @@ static void setup_push_tracking(void)
64
add_refspec(refspec.buf);
65
}
66
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
-
67
static void setup_default_push_refspecs(void)
68
{
69
git_config(git_default_config, NULL);
70
switch (push_default) {
93
- case PUSH_DEFAULT_UNSPECIFIED:
94
- warn_unconfigured_push();
95
- /* fallthrough */
96
-
71
+ default:
72
case PUSH_DEFAULT_MATCHING:
73
add_refspec(":");
74
break;
cache.h
-1
@@ -543,7 +543,6 @@ enum rebase_setup_type {
543
};
544
545
enum push_default_type {
546
- PUSH_DEFAULT_UNSPECIFIED = -1,
546
PUSH_DEFAULT_NOTHING = 0,
547
PUSH_DEFAULT_MATCHING,
548
PUSH_DEFAULT_TRACKING,
environment.c
+1
-1
@@ -42,7 +42,7 @@ enum safe_crlf safe_crlf = SAFE_CRLF_WARN;
42
unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;
43
enum branch_track git_branch_track = BRANCH_TRACK_REMOTE;
44
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;
46
#ifndef OBJECT_CREATION_MODE
47
#define OBJECT_CREATION_MODE OBJECT_CREATION_USES_HARDLINKS
48
#endif