Re* [1.8.0] Provide proper remote ref namespaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johan Herland <johan@xxxxxxxxxxx> writes:

> It's not, except that "refs/*:refs/remotes/origin/*" would fetch a too-large 
> superset. E.g. it would fetch "refs/remotes/third-party/heads/foo" into 
> "refs/remotes/origin/remotes/third-party/heads/foo", which we probably don't 
> want.

Ah, very true.  We are generally not interested in remote's remotes that
possibly include ourselves ;-)

> "Now you could argue that auto-follow is not worth the effort. It is
> somewhat confusing, and I can't think of a time when it ever actually
> reduced the set of objects I was fetching (as opposed to just fetching
> all tags). But maybe others have use cases where it matters."
>
> So if nobody disagree, I would have no problem with dropping the leading "~" 
> from the refspec, thus disabling auto-following (tracking all tags 
> explicitly instead).

I am not sure what you mean by this.  I think we agree that it would be Ok
if you cannot add "~" in front to cause automatic following when tracking
tags in separate namespaces using "refs/tags/*:refs/remotes/origin/tags/*".

But are you saying:

 (1) There is no other change than that; or

 (2) Even when not using such a refspec i.e. using the traditional "tags
     live in a single global namespace", automatic following feature will
     be disabled;

I would be moderately unhappy if the latter.

> ... However, what I've seen at $dayjob is 
> that more inexperienced users will often push right after committing, and at 
> that time they're still very much in the "working-on-one-branch" state of 
> mind (as opposed to the "administering-multiple-branches" state of mind),...

Then "current" mode is a good setting for them, I would presume.  I don't
think it is a bad idea to make that the default given sufficient lead time
to warn the current users, and if we want to make the switch at 1.8.0, the
time to start issuing a warning is now.  Perhaps like this.

-- >8 --
Subject: [1.8.0 RFC] push: start warning upcoming default change for push.default

More inexperienced users will often push right after committing, and at
that time they're still very much in the "working-on-one-branch" state of
mind.  "current" would be a safer default mode of operation for 'git push'
for them even when they have their personal publishing repository (also in
a shared public repository settings, "matching" is rarely the right
default mode).

In preparation for flipping the default to the "current" mode from the
"matching" mode that is the current default, start warning users when they
rely on unconfigured "git push" to default to the "matching" mode.

Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
---
 builtin/push.c |   13 +++++++++++++
 cache.h        |    1 +
 environment.c  |    2 +-
 3 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/builtin/push.c b/builtin/push.c
index e655eb7..fe6665e 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -80,10 +80,23 @@ static void setup_push_tracking(void)
 	add_refspec(refspec.buf);
 }
 
+static void warn_unspecified_push_default_configuration(void)
+{
+	static int warn_once;
+
+	if (warn_once++)
+		return;
+	warning("You do not have an explicit 'matching' setting for push.default");
+	warning("Your workflow will be broken at 1.8.0 unless you do so now");
+}
+
 static void setup_default_push_refspecs(void)
 {
 	switch (push_default) {
 	default:
+	case PUSH_DEFAULT_UNSPECIFIED:
+		warn_unspecified_push_default_configuration();
+		/* fallthru */
 	case PUSH_DEFAULT_MATCHING:
 		add_refspec(":");
 		break;
diff --git a/cache.h b/cache.h
index d83d68c..6c47867 100644
--- a/cache.h
+++ b/cache.h
@@ -606,6 +606,7 @@ 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 9564475..577177f 100644
--- a/environment.c
+++ b/environment.c
@@ -47,7 +47,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_MATCHING;
+enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED;
 #ifndef OBJECT_CREATION_MODE
 #define OBJECT_CREATION_MODE OBJECT_CREATION_USES_HARDLINKS
 #endif

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]