git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Sean <seanlkml@sympatico.ca>
Cc: Matthias Hopf <mhopf@suse.de>,
	Alan Coopersmith <alan.coopersmith@sun.com>,
	xorg@lists.freedesktop.org,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Default modules to load ...
Date: Tue, 24 Oct 2006 21:58:16 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0610242145040.3962@g5.osdl.org> (raw)
In-Reply-To: <BAYC1-PASMTP013A64CB1BD217DE7EE26AAE010@CEZ.ICE>



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.


           reply	other threads:[~2006-10-25  4:58 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <BAYC1-PASMTP013A64CB1BD217DE7EE26AAE010@CEZ.ICE>]

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=Pine.LNX.4.64.0610242145040.3962@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=alan.coopersmith@sun.com \
    --cc=git@vger.kernel.org \
    --cc=mhopf@suse.de \
    --cc=seanlkml@sympatico.ca \
    --cc=xorg@lists.freedesktop.org \
    /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).