git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Default modules to load ...
       [not found]     ` <BAYC1-PASMTP013A64CB1BD217DE7EE26AAE010@CEZ.ICE>
@ 2006-10-25  4:58       ` Linus Torvalds
  0 siblings, 0 replies; only message in thread
From: Linus Torvalds @ 2006-10-25  4:58 UTC (permalink / raw)
  To: Sean; +Cc: Matthias Hopf, Alan Coopersmith, xorg, Git Mailing List



On Tue, 24 Oct 2006, Sean wrote:
> 
> Add Linus to CC so maybe you'll get better answers than I can offer.

The git list is probably even better.. Added to the Cc:

> > Hm. And why don't I find this in my regularly cloned and updated git
> > repository? I just noted that I wouldn't find this commit after a
> > 'git-pull', but it would after a 'git-pull -t'.
> 
> "Git-pull -t" pulls down all remote tags (regardless of which branch
> they're on) and then grabs all the commits they point to.  But it
> won't actually pull down the full branch references.  Typically,
> you don't ever need to use "-t".

Correct. 

Normally, git only tracks the branches you _asked_ it to track. It will 
follow any tags that happen along those branches, but it won't follow 
branches you haven't asked it to follow.

The reason is actually very simple: people track different things, and 
there is _not_ a 1:1 "local repository" to "parent repository" tracking. 
It's quite possible (and even sensible) to track two _different_ remote 
repositories in the same local repository, and adding branches just 
because the remote repository has a branch that you don't track, would 
actually be really _wrong_.

> "Git-pull" pulls down all the new commits for the branches you're
> following, and then any tags associated with any of the commits
> you pulled.

Yes, again with the exception that it's limited to just branches you share 
with _that_ repository. This is important to understand not because it is 
important in itself, but because it explains the behaviour. Once you 
realize that there's not any real 1:1 relationship, the git behaviour 
makes sense, and anythign else would actually be a bad idea.

That said, we could possibly try to introduce a special _flag_ saying "add 
new branches from this remote repository automatically", if that is 
actually a common issue.

> > So this basically boils down to the question:
> > 
> >   How on earth am I supposed to keep up with an upstream repository, if
> >   'git-pull -t' is not doing enough? Nobody can't be suggesting doing a
> >   new git-clone all the time...
> 
> You shouldn't really ever need "git-pull -t"; just use "git pull".  It will
> automatically grab all the tags you need.
> 
> But you will need to explicitly add new branches into your repo if you
> want to follow them.  Perhaps Git could make this easier.

It actually is very easy already. You just need to be aware of the new 
branch you want to track (which you can either be when somebody just 
_tells_ you about it, or you can figure it out with "git ls-remote"), 
and then you just do

	git fetch origin remotebranch:localbranch

and you now have that branch locally.

Now, if you want to continue to _track_ that branch, you probably want to 
just tell git so explicitly, and the easiest way tends to just edit the 
".git/remotes/origin" file, which has such a simple format that I don't 
think you even need to read the documentation, and you will just _guess_ 
what you should do.

But yeah, if somebody wants to send Junio a

	git addbranch

script (a line or two of shell), go wild. It should be easy, and you'll 
get the satisfaction of being able to use a command that you know you 
wrote yourself!  It really isn't very complicated.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-25  4:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20061020140918.GA12400@suse.de>
     [not found] ` <45390142.7010808@sun.com>
     [not found]   ` <20061024121754.GA11716@suse.de>
     [not found]     ` <BAYC1-PASMTP013A64CB1BD217DE7EE26AAE010@CEZ.ICE>
2006-10-25  4:58       ` Default modules to load Linus Torvalds

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).