Re: [RFC] Fourth round of support for cloning submodules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Thu, 24 May 2007, Junio C Hamano wrote:
> 
> Why does this have to be out-of-tree and unversioned to begin
> with?

I _really_ think that the right approach is to

 - have the submodules information under version control (and I'd 
   personally call it the ".gitmodules" file, but whatever)

   This gives you the defaults, and the ability to change them. Remember: 
   if you get some "config" information at "git clone" time, you're 
   *screwed* if the thing ever changes!

   So being version-controlled is not just a good idea. It's a 
   _requirement_ for working well.

 - have a way to *override* the version-controlled information using a 
   local config file.

   This is what you'd use to say "ignore the official information, it's 
   either slow (because the "official" server is on another continent) or 
   outdated (because the server went away)".

I actually really liked Junio's suggestion of

	[subproject "git://git.kernel.org/pub/linux-2.4.git"]
		URL = http://www.kernel.org/pub/linux-2.4.git

except I would actually make it a bit more generic, in that I don't think 
this kind of "URL rewriting" is necessarily even subproject-specific, but 
could be useful in general. IOW, it might be a good idea to have

	[url "git://git.kernel.org/pub/linux-2.4.git"]
		rewrite = "ssh://master.kernel.org/pub/linux-2.4.git"

or something - which allows people to set up automatic rewriting rules in 
case they have alternate ways of getting to better repositories (ie people 
might send me a "please pull" request with a pointer to the _public_ site, 
because they also Cc: the kernel mailing list, but since I have direct SSH 
access to the master site, _I_ might want to rewrite it to use that 
instead!).

Note how that example had nothing to do with subprojects per se: the URL 
rewriting is really another issue. But yes, I think it might also be worth 
it to actually be able to override the whole subproject data, ie also have

	[subproject "kernel/"]
		url = ...
		branch = xyzzy

and allow that kind of information in .git/config to _override_ any such 
entry in .gitmodules!

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux