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

Subsystems: the rest

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:28

Junio C Hamano [off-list ref] writes:
Jonathan Nieder [off-list ref] writes:
quoted
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.
Perhaps.  Do we need to rephrase it without using the word 'refspec'
(e.g. "without telling me what to push"), or there is no point avoiding
jargon because other jargons (i.e. 'remote' and 'upstream') already appear
in the sentence?
How about phrasing it this way?

Note that the short-looking first line (in the context) and the second
line (updated) of the message are very much on purpose, to give '%s'
enough room to expand without overflowing the usual terminal width.

 builtin/push.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/builtin/push.c b/builtin/push.c
index 765b19c..7a20036 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -99,7 +99,9 @@ static void setup_push_upstream(struct remote *remote)
 		    "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"),
+		      "upstream of your\ncurrent branch '%s',\n"
+		      "without telling me to push which local branch to\n"
+		      " update which remote branch with."),
 		    remote->name, branch->name);
 
 	strbuf_addf(&refspec, "%s:%s", branch->name, branch->merge[0]->src);

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

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

Junio C Hamano wrote:
How about phrasing it this way?
[
	fatal: You are pushing to remote '%s', which is not the upstream of your
	current branch '%s',
	without telling me to push which local branch to
	 update which remote branch with.
]

I think some words got jumbled a little.  But in that spirit, maybe
here's a start:

	fatal: You are pushing to remote 'somethinglong',
	which is not the upstream of your current branch 'something/very/long',
	without telling me which local branches to use to update which
	remote branches.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help