git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Carlos Martín Nieto" <cmn@elego.de>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] branch: make sure the upstream remote is configured
Date: Sat, 27 Jul 2013 00:29:47 +0200	[thread overview]
Message-ID: <1374877787.2670.6.camel@centaur.cmartin.tk> (raw)
In-Reply-To: <20130726184311.GA29799@sigill.intra.peff.net>

On Fri, 2013-07-26 at 14:43 -0400, Jeff King wrote:
> On Fri, Jul 26, 2013 at 07:39:37PM +0200, Carlos Martín Nieto wrote:
> 
> > A command of e.g.
> > 
> >     git push --set-upstream /tmp/t master
> > 
> > will call install_branch_config() with a remote name of "/tmp/t". This
> > function will set the 'branch.master.remote' key to, which is
> > nonsensical as there is no remote by that name.
> 
> Is it nonsensical? It does not make sense for the @{upstream} magic
> token, because we will not have a branch in tracking branch refs/remotes

This was the main point, yes; the only time I've seen it used is by
mistake/misunderstanding, and thinking that you wouldn't want to do
something like what's below.

You are also unable to do this kind of thing through git-branch, and as
it seemed to be an oversight, I wanted to tighten it up.

> to point to. But the configuration would still affect how "git pull"
> chooses a branch to fetch and merge.
> 
> I.e., you can currently do:
> 
>   git push --set-upstream /tmp/t master
>   git pull ;# pulls from /tmp/t master

Interestingly, this actually fetches the right branch from the remote. I
wasn't expecting something like this to work at all.

Somewhat doubtful that this usage is something you'd really want to do,
I see that it does behave properly.

   cmn

  parent reply	other threads:[~2013-07-26 22:39 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 [this message]
2013-07-26 23:12     ` Jeff King
2013-07-26 23:22       ` Jeff King

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=1374877787.2670.6.camel@centaur.cmartin.tk \
    --to=cmn@elego.de \
    --cc=git@vger.kernel.org \
    --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).