git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
	Matthieu Moy <Matthieu.Moy@imag.fr>
Subject: Re: [PATCH] push: error out when the "upstream" semantics does not make sense
Date: Thu, 5 Apr 2012 13:43:45 -0500	[thread overview]
Message-ID: <20120405184345.GA6448@burratino> (raw)
In-Reply-To: <7v1uo26ue9.fsf_-_@alter.siamese.dyndns.org>

Junio C Hamano wrote:

> --- a/builtin/push.c
> +++ b/builtin/push.c
> @@ -65,6 +65,16 @@ static void set_refspecs(const char **refs, int nr)
[...]
> @@ -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.

  reply	other threads:[~2012-04-05 18:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04 23:26 What's cooking in git.git (Apr 2012, #02; Wed, 4) Junio C Hamano
2012-04-05 12:47 ` Jeff King
2012-04-05 16:00   ` [PATCH] push: error out when the "upstream" semantics does not make sense Junio C Hamano
2012-04-05 18:43     ` Jonathan Nieder [this message]
2012-04-05 19:48       ` Junio C Hamano
2012-04-05 19:58         ` Jonathan Nieder
2012-04-05 20:01         ` Junio C Hamano
2012-04-05 20:23           ` Jonathan Nieder
2012-04-05 20:24           ` Matthieu Moy
2012-04-05 20:34             ` Junio C Hamano
2012-04-06  7:16               ` Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120405184345.GA6448@burratino \
    --to=jrnieder@gmail.com \
    --cc=Matthieu.Moy@imag.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).