diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-07-18 17:19:47 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-07-18 17:20:52 -0700 |
commit | bba0fd22ad654460a81c4b35462b600d9432a869 (patch) | |
tree | f05a76c5f82b6947704b85ed4a4e9c9e879fd9d6 | |
parent | d5cee0f78654357965cb88c4e6d3cfa272d9ae28 (diff) | |
download | git-bba0fd22ad654460a81c4b35462b600d9432a869.tar.gz git-bba0fd22ad654460a81c4b35462b600d9432a869.tar.xz |
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>
-rw-r--r-- | builtin-push.c | 27 | ||||
-rw-r--r-- | cache.h | 1 | ||||
-rw-r--r-- | environment.c | 2 |
3 files changed, 2 insertions, 28 deletions
diff --git a/builtin-push.c b/builtin-push.c index 0a0297f98..1d92e22f0 100644 --- a/builtin-push.c +++ b/builtin-push.c @@ -64,36 +64,11 @@ static void setup_push_tracking(void) add_refspec(refspec.buf); } -static const char *warn_unconfigured_push_msg[] = { - "You did not specify any refspecs to push, and the current remote", - "has not configured any push refspecs. The default action in this", - "case is to push all matching refspecs, that is, all branches", - "that exist both locally and remotely will be updated. This may", - "not necessarily be what you want to happen.", - "", - "You can specify what action you want to take in this case, and", - "avoid seeing this message again, by configuring 'push.default' to:", - " 'nothing' : Do not push anything", - " 'matching' : Push all matching branches (default)", - " 'tracking' : Push the current branch to whatever it is tracking", - " 'current' : Push the current branch" -}; - -static void warn_unconfigured_push(void) -{ - int i; - for (i = 0; i < ARRAY_SIZE(warn_unconfigured_push_msg); i++) - warning("%s", warn_unconfigured_push_msg[i]); -} - static void setup_default_push_refspecs(void) { git_config(git_default_config, NULL); switch (push_default) { - case PUSH_DEFAULT_UNSPECIFIED: - warn_unconfigured_push(); - /* fallthrough */ - + default: case PUSH_DEFAULT_MATCHING: add_refspec(":"); break; @@ -543,7 +543,6 @@ enum rebase_setup_type { }; enum push_default_type { - PUSH_DEFAULT_UNSPECIFIED = -1, PUSH_DEFAULT_NOTHING = 0, PUSH_DEFAULT_MATCHING, PUSH_DEFAULT_TRACKING, diff --git a/environment.c b/environment.c index 801a005ef..720f26b67 100644 --- a/environment.c +++ b/environment.c @@ -42,7 +42,7 @@ enum safe_crlf safe_crlf = SAFE_CRLF_WARN; unsigned whitespace_rule_cfg = WS_DEFAULT_RULE; enum branch_track git_branch_track = BRANCH_TRACK_REMOTE; enum rebase_setup_type autorebase = AUTOREBASE_NEVER; -enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED; +enum push_default_type push_default = PUSH_DEFAULT_MATCHING; #ifndef OBJECT_CREATION_MODE #define OBJECT_CREATION_MODE OBJECT_CREATION_USES_HARDLINKS #endif |