git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Avery Pennarun <apenwarr@gmail.com>,
	Tom Lambda <tom.lambda@gmail.com>,
	git@vger.kernel.org
Subject: Re: Question regarding git fetch
Date: Thu, 27 Aug 2009 17:39:24 -0400	[thread overview]
Message-ID: <20090827213924.GE4399@coredump.intra.peff.net> (raw)
In-Reply-To: <7viqg9q7gx.fsf@alter.siamese.dyndns.org>

On Thu, Aug 27, 2009 at 02:20:46PM -0700, Junio C Hamano wrote:

> I think it is reasonable, in 1.7.0, to change "git fetch" with command
> line refspacs that lack colon (i.e. saying "fetch this ref" without saying
> "and store it here") so that it updates remote tracking refs if and only
> if an appropriate remote.$remote.fetch is configured to do so.  E.g. when
> I fetch from Eric for git-svn updates with
> 
> 	$ git pull git-svn master
> 
> because I do have
> 
> 	[remote "git-svn"]
>                 url = git://yhbt.net/git-svn
>                 fetch = +refs/heads/*:refs/remotes/git-svn/*

Does the colon really matter? That is, should

  $ git fetch git-svn master

store a tracking ref, but

  $ git fetch git-svn master:foo

not? In both cases, git has learned during the course of an operation
what the new value of the tracking ref could be, so why not store it?

The obstacle I see is that somebody may be using configured refspecs as
something other than a tracking ref. That is, they care about _when_
those refs on the RHS of the refspec are updated, and are not treating
them just as a cache of what the remote side has.

> On the other hand, if my refspecs for "git svn" _were_ like this:
> 
> 	[remote "git-svn"]
> 		url = git://yhbt.net/git-svn
>                 fetch = +refs/heads/master:refs/remotes/git-svn/master
> 
> then I would _not_ want this:
> 
> 	$ git fetch git-svn dev
> 
> to create a new tracking branch refs/remotes/git-svn/dev.

Of course not. It's not in your configured refspec, so you have
requested no such tracking ref. I think we would have to limit ourselves
to how the tracking refs are defined in the refspecs. Otherwise how
would we know to put the tracking ref in refs/remotes/git-svn and not
some other place?

So I think it is a simple matter of applying the configured refspecs
with information we happen to have gotten during the course of a
somewhat-related operation.

-Peff

  reply	other threads:[~2009-08-27 21:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-27 15:30 Question regarding git fetch Tom Lambda
2009-08-27 15:36 ` Avery Pennarun
2009-08-27 16:21   ` Eric Raible
2009-08-27 16:28     ` Avery Pennarun
2009-08-27 16:46   ` Björn Steinbrink
2009-08-27 17:22     ` Avery Pennarun
2009-08-27 20:48       ` Jeff King
2009-08-27 21:34         ` Jeff King
2009-08-27 21:44           ` Junio C Hamano
2009-08-27 21:50             ` Jeff King
2009-08-27 21:53               ` Jeff King
2009-08-27 22:12               ` Avery Pennarun
2009-08-27 22:16                 ` Jeff King
2009-08-27 22:24                   ` Avery Pennarun
2009-08-27 21:20   ` Junio C Hamano
2009-08-27 21:39     ` Jeff King [this message]
2009-08-28 13:24 ` Tom Lambda

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=20090827213924.GE4399@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=apenwarr@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=tom.lambda@gmail.com \
    /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).