git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Thomas Rast <trast@student.ethz.ch>,
	Hilco Wijbenga <hilco.wijbenga@gmail.com>,
	Git Users <git@vger.kernel.org>
Subject: Re: Your branch and 'origin/master' have diverged
Date: Thu, 16 Aug 2012 12:24:18 -0400	[thread overview]
Message-ID: <20120816162417.GD2853@sigill.intra.peff.net> (raw)
In-Reply-To: <7va9xw55aj.fsf@alter.siamese.dyndns.org>

On Wed, Aug 15, 2012 at 12:22:28PM -0700, Junio C Hamano wrote:

> > The updated rule would be more complex.  If a remote nickname is
> > used, and a refspec given from the command line is without colon, a
> > new special rule overrides the current behaviour and tries to match
> > with a configured refspec.  You would need to desribe what happens
> > in that case.
> 
> It would be something like this.
> 
> When you tell "git fetch" to fetch one or more refs from a
> configured remote by explicitly listing them on the command line,
> e.g.
> 
>     git fetch <remote> <name>...
> 
> each <name>... goes through the following process:
> 
>     - The <name> is turned into the full ref at the remote that
>       starts from refs/ form by applying the usual fetch dwimmery
>       (if <name> is a name of a branch, "refs/heads/<name>" would
>       likely to be the one that is fetched).
> 
>     - Then, configured fetch refspecs for <remote> is looked up from
>       remote.<remote>.fetch configuration variable(s), or "Pull: "
>       line(s) of .git/remotes/<remote> file.
> 
>     - If the LHS of a refspec found in the previous step matches the
>       full ref we computed in the first step, then the ref at the
>       RHS of the refspec (i.e. remote tracking branch), if any, is
>       updated.
> 
> If there is no configured refspecs that match the name given from
> the command line, no remote tracking ref is updated.

That is almost exactly what my patch does, except I am not sure that it
respects the "without a colon" bit from your first message. In other
words, any time it sees that we have fetched a ref from a particular
remote, it applies the mapping from the config and adds the result to
the list of refs to be updated.

-Peff

  reply	other threads:[~2012-08-16 16:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-13 19:58 Your branch and 'origin/master' have diverged Hilco Wijbenga
2012-08-14  8:27 ` Thomas Rast
2012-08-14 17:04   ` Hilco Wijbenga
2012-08-14 17:19     ` Junio C Hamano
2012-08-14 18:32       ` Hilco Wijbenga
2012-08-14 18:49         ` Junio C Hamano
2012-08-14 20:12         ` Thomas Rast
2012-08-14 20:49           ` Junio C Hamano
2012-08-15  6:59             ` Thomas Rast
2012-08-15 17:30               ` Junio C Hamano
2012-08-15 18:38                 ` Holger Hellmuth (IKS)
2012-08-15 19:07                   ` Junio C Hamano
2012-08-15 19:22                 ` Junio C Hamano
2012-08-16 16:24                   ` Jeff King [this message]
2012-08-16 17:57                     ` Junio C Hamano
2012-08-16 16:21               ` Jeff King
2012-08-14 22:15           ` Hilco Wijbenga
2012-08-14 22:35             ` Junio C Hamano
2012-08-14 16:02 ` PJ Weisberg
2012-08-14 17:07   ` Hilco Wijbenga

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=20120816162417.GD2853@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hilco.wijbenga@gmail.com \
    --cc=trast@student.ethz.ch \
    /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).