From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Avery Pennarun <apenwarr@gmail.com>
Cc: Tom Lambda <tom.lambda@gmail.com>, git@vger.kernel.org
Subject: Re: Question regarding git fetch
Date: Thu, 27 Aug 2009 18:46:57 +0200 [thread overview]
Message-ID: <20090827164657.GA17090@atjola.homenet> (raw)
In-Reply-To: <32541b130908270836m50553ccatddf4c870eec54ddb@mail.gmail.com>
On 2009.08.27 15:36:53 +0000, Avery Pennarun wrote:
> On Thu, Aug 27, 2009 at 3:30 PM, Tom Lambda<tom.lambda@gmail.com> wrote:
> > What was a little bit surprising to me is that running "git fetch central
> > master" does not update refs/remotes/central/master but simply updates
> > FETCH_HEAD.
>
> I've often wanted this myself, especially when doing things like "git
> pull origin master". However, I know the current behaviour is also
> useful sometimes, and changing it would introduce an unexpected side
> effect. Git currently promises that your refs/remotes/* branches will
> never be updated unless you explicitly request it, even if you're
> fetching, merging, and pulling other stuff. This means you can write
> scripts to do complicated things without triggering unexpected
> user-visible side effects.
>
> So basically, I agree that it would often be much more user-friendly
> to do what you're asking. But it would be less scripting-friendly. I
> don't think anyone has thought of an answer that better balances the
> two.
It would also be pretty hard to implement that. Given the default fetch
refspec, it would "simply" be a matter of mapping the given ref to the
refspec, so e.g. "foo" becomes "refs/heads/foo:refs/remotes/origin/foo".
But even just using "git remote add -t master foo git://..." breaks
that, as the fetch refspec in the config will no longer be a glob, and
thus no such mapping is possible.
Björn
next prev parent reply other threads:[~2009-08-27 16:47 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 [this message]
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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090827164657.GA17090@atjola.homenet \
--to=b.steinbrink@gmx.de \
--cc=apenwarr@gmail.com \
--cc=git@vger.kernel.org \
--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.
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).