Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] push: error out when the "upstream" semantics does not make sense

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:53:28

Possibly related (same subject, not in this thread)

Junio C Hamano wrote:
quoted hunk ↗ jump to hunk
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -65,6 +65,16 @@ static void set_refspecs(const char **refs, int nr)
[...]
quoted hunk ↗ jump to hunk
@@ -87,6 +97,11 @@ static void setup_push_upstream(struct remote *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 your\ncurrent branch '%s'.\n"),
+		    remote->name, branch->name);
+
I worry that a beginner seeing this message would think it means that
when "master" is set up to track origin/master that there is no way to
push that branch to any other repository.

Maybe something like

		die(_(
"You are pushing to remote '%s', which is not the upstream of your\n"
"current branch '%s', without specifying a refspec.\n"),
		    remote->name, branch->name);

would be harder to misunderstand.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help