git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [ANNOUNCE] GIT 1.6.4.rc1

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 19, 2009, 00:19 UTC
Message-ID
<7vskgt1q3t.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20090719080558.6117@nanako3.lavabit.com>
Nanako Shiraishi <nanako3@lavabit.com> writes:
Show 18 quoted lines
> Quoting Junio C Hamano <gitster@pobox.com> writes:
>
>> When the user does not tell "git push" what to push, it has always
>> pushed matching refs.  For some people it is unexpected, and a new
>> configuration variable push.default has been introduced to allow
>> changing a different default behaviour.  To advertise the new feature,
>> a big warning is issued if this is not configured and a git push without
>> arguments is attempted.
>>
>> 	Side note: we might want to tone this down, as it does not seem
>> 	likely for us to change the default behaviour when this option is
>> 	not set.
>
> I thought you applied this patch from Finn Arne:
>
>     http://article.gmane.org/gmane.comp.version-control.git/119173
>
> but apparently you didn't.

I wrote that side note after googling around and found that many users outside git community wondering what a strange way to announce a new feature it was, and I think they are right. I stupidly said that we should tone the message neutral, because we might want to change the default in the future but we are still not committed. But the end result is just a confusing advertisement of an optional feature.

I actually think that the right course of action at this point is this patch instead. We keep the default, we do not annoy the users, and people who want to use a non-default configuration can use the feature.

-- >8 --
Subject: do not give big warning when push preference is unconfigured

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>
---
 builtin-push.c |   27 +--------------------------
 cache.h        |    1 -
 environment.c  |    2 +-
 3 files changed, 2 insertions(+), 28 deletions(-)
diff --git a/builtin-push.c b/builtin-push.c
index 0a0297f..1d92e22 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;
diff --git a/cache.h b/cache.h
index f1e5ede..c72f125 100644
--- a/cache.h
+++ b/cache.h
@@ -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 801a005..720f26b 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
Previous: Nanako ShiraishiNext: Nanako Shiraishi
Message 18 of 19 in “[ANNOUNCE] GIT 1.6.4.rc1”
  1. Junio C HamanoJul 16, 2009
  2. Tommy NordgrenJul 16, 2009
  3. Mike RalphsonJul 16, 2009
  4. Tommy NordgrenJul 17, 2009
  5. Jeff GarzikJul 16, 2009
  6. Junio C HamanoJul 16, 2009
  7. Jeff GarzikJul 16, 2009
  8. Jeff GarzikJul 16, 2009
  9. Felipe BalbiJul 16, 2009
  10. Jeff GarzikJul 16, 2009
  11. Felipe BalbiJul 16, 2009
  12. Junio C HamanoJul 16, 2009
  13. Jeff GarzikJul 16, 2009
  14. Junio C HamanoJul 16, 2009
  15. Jeff GarzikJul 16, 2009
  16. [ANNOUNCE] Re: GIT 1.6.4.rc1Nicolas Sebrecht, Jul 16, 2009
  17. Nanako ShiraishiJul 18, 2009
  18. Junio C HamanoJul 19, 2009
  19. Nanako ShiraishiJul 19, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.