git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Carlos Martín Nieto" <cmn@elego.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] branch: make sure the upstream remote is configured
Date: Fri, 26 Jul 2013 19:22:09 -0400	[thread overview]
Message-ID: <20130726232208.GC12968@sigill.intra.peff.net> (raw)
In-Reply-To: <20130726231211.GB12968@sigill.intra.peff.net>

On Fri, Jul 26, 2013 at 07:12:11PM -0400, Jeff King wrote:

> If that is what you want to prevent, I do not think checking for a named
> remote is sufficient. You can also be pushing to a branch on a named
> remote that is not part of your fetch refspec, in which case you do not
> have a tracking branch. I.e.:
> 
>   git clone $URL repo.git
>   cd repo.git
>   git push --set-upstream HEAD:refs/foo/whatever
> 
> For that matter, I wonder what "--set-upstream" would do if used with
> "refs/tags/foo". You would not do that in general, but what about:
> 
>   git push --set-upstream master:master master:v1.0
> 
> I didn't test.

Ah, nevermind. We already catch the case of non-heads (on both the local
and remote sides) and abort.

So that makes me more confident that your change is a reasonable one; we
are already disallowing a subset of what's possible via "--set-upstream"
in the name of preventing weird accidental configurations. This is just
fixing another such loophole.

-Peff

      reply	other threads:[~2013-07-26 23:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26 17:39 [PATCH] branch: make sure the upstream remote is configured Carlos Martín Nieto
2013-07-26 18:43 ` Jeff King
2013-07-26 18:48   ` Jeff King
2013-07-26 22:29   ` Carlos Martín Nieto
2013-07-26 23:12     ` Jeff King
2013-07-26 23:22       ` Jeff King [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20130726232208.GC12968@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=cmn@elego.de \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).