Thread (1 message) 1 message, 1 author, 2016-06-15

Re: branch.<name>.pushremote not working with push.default simple or upstream

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:35

Ramkumar Ramachandra [off-list ref] writes:
Junio C Hamano wrote:
quoted
This shows the "triangular" support in 1.8.3 is only half-finished;
the other half was discussed a few weeks ago ($gmane/224604)
I intentionally omitted that detail, because it is not directly
related to this bug.  We have to fix the existing simple and upstream,
whether or not we introduce branch.<name>.push.  I've personally
stopped working on branch.<name>.push, and am focusing on getting @{p}
first (you've already seen a dirty wip).  The transport code
underlying the push is dirty enough, and I'd first like to understand
it before bolting on more features.
quoted
I think the
natural extension of the current end-user configuration would be to
redefine "upstream" mode to push to update the branch with the same
name
Right, so does this work?
It might be a beginning of a change in the right direction (I didn't
check the codeflow), but given that the test that comes after the
one you removed is looking at branch->merge[0] and deciding what to
do, and branch.$name.merge should *never* affect anything when
remote.pushdefault or branch.$name.pushremote is in use while
deciding what is pushed out or if the push is allowed, I do not
think the removal of these five lines alone can possibly "work".
quoted hunk
diff --git a/builtin/push.c b/builtin/push.c
index 2d84d10..b253a64 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -137,11 +137,6 @@ static void setup_push_upstream(struct remote
 	if (branch->merge_nr != 1)
 		die(_("The current branch %s has multiple upstream branches, "
 		    "refusing to push."), branch->name);
-	if (strcmp(branch->remote_name, remote->name))
-		die(_("You are pushing to remote '%s', which is not the upstream of\n"
-		      "your current branch '%s', without telling me what to push\n"
-		      "to update which remote branch."),
-		    remote->name, branch->name);
 	if (simple && strcmp(branch->refname, branch->merge[0]->src))
 		die_push_simple(branch, remote);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help