Re: Default modules to load ...

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Tuesday, October 24, 2006 - 9:58 pm

On Tue, 24 Oct 2006, Sean wrote:

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


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


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.


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.

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Default modules to load ..., Linus Torvalds, (Tue Oct 24, 9:58 pm)