git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Let .git/config specify the url for submodules

From
SVSven Verdoolaege <skimo@kotnet.org>
Date
Jun 2, 2007, 17:35 UTC
Message-ID
<20070602173551.GC955MdfPADPa@greensroom.kotnet.org>
In-Reply-To
<alpine.LFD.0.98.0706020923170.23741@woody.linux-foundation.org>
On Sat, Jun 02, 2007 at 09:34:26AM -0700, Linus Torvalds wrote:
Show 45 quoted lines
> On Sat, 2 Jun 2007, Sven Verdoolaege wrote:
> > On Fri, Jun 01, 2007 at 09:29:58AM -0700, Linus Torvalds wrote:
> > > 	[module "infrastructure"]
> > > 		submodule = lib
> > > 		submodule = build
> > > 
> > > 	[submodule "lib"]
> > > 		url = git://xyzzy/lib-1.2.3
> > > 
> > > 	[submodule "build"]
> > > 		url = git://xyzzy/build-0.61
> > > 
> > > 
> > > IOW, in the above case, we have *three* modules:
> > > 
> > >  - module "infrastructure", that is the union of submodules/paths "lib" 
> > >    and "build"
> > >  - module "lib" (== submodule/path "lib")
> > >  - module "build" (== submodule/path "build")
> > 
> > If there are three modules, then why is one in the "module" section
> > and the other two in the "submodule" section?
> 
> Because there are:
> 
>  - *two* actual submodules (== path), namely "lib" and "build".
> 
>  - each submodule always is *implicitly* a module too
> 
>  - we have a *named* (aka explicit) module "infrastructure" that is a 
>    higher-level name for one or more submodules (in this case two).
> 
> So the implicit modules could have been written out:
> 
> 	[module "lib"]
> 		submodule = "lib" 	# aka 'path = "lib"'
> 
> 	 [module "build"]
> 		submodule = "build"	# aka 'path = "build"'
> 
> but my suggestion was that if the module name and the path name are the 
> same, you don't need to say it.
> 
> (And quite frankly, I think it reads better as "submodule" than as "path", 
> but maybe that threw you).

I did indeed glance over the "submodule == path" in your mail (and it seems Junio did so too). I thought it was more or less agreed that the URL should be associated to the logical module rather than the path (which you call "submodule" here). See http://article.gmane.org/gmane.comp.version-control.git/47567 .

Personally, I find your section names confusing. Both your "submodule"s and "module"s are submodules from the point of view of the project containing the .gitmodules. And anything in the "submodule" section is only a (proper) submodule of some other module if there happens to be a "module" containing it.

What's wrong with the following?
	[module "infrastructure"]
		submodule = lib
		submodule = build
	[module "lib"]
		url = git://xyzzy/lib-1.2.3
	[module "build"]
		url = git://xyzzy/build-0.61

A module with a "url" attribute can be cloned from that url. A module with one or more "submodule" attributes requires these modules as well.

Show 5 quoted lines
> > Why not allow a module to both contain smaller modules and be contained
> > in a bigger module?
> 
> Because the "module" definition is _different_ from the "submodule" 
> definition.
>From the point of view of the user, they are the same.
They can both be used as an argument to
	git submodule checkout
> The "module" definition is just a level of indirection.

But why limit yourself to _one_ level of indirection? If you call everything a "module" (or everything a "submodule") then you get multiple levels of indirection for free.

skimo
Previous: Linus Torvalds
Message 31 of 31 in “Let .git/config specify the url for submodules”
  1. Let .git/config specify the url for submodulesLars Hjemli, May 28, 2007
  2. Lars HjemliMay 31, 2007
  3. Junio C HamanoMay 31, 2007
  4. Josef WeidendorferJun 1, 2007
  5. Lars HjemliJun 1, 2007
  6. Sven VerdoolaegeJun 1, 2007
  7. Lars HjemliJun 1, 2007
  8. Sven VerdoolaegeJun 1, 2007
  9. Lars HjemliJun 1, 2007
  10. Sven VerdoolaegeJun 1, 2007
  11. Lars HjemliJun 1, 2007
  12. Linus TorvaldsJun 1, 2007
  13. Junio C HamanoJun 1, 2007
  14. Lars HjemliJun 2, 2007
  15. Sven VerdoolaegeJun 2, 2007
  16. Lars HjemliJun 2, 2007
  17. Junio C HamanoJun 2, 2007
  18. Lars HjemliJun 2, 2007
  19. Junio C HamanoJun 2, 2007
  20. Lars HjemliJun 2, 2007
  21. Sven VerdoolaegeJul 25, 2007
  22. Lars HjemliJul 25, 2007
  23. Johannes SchindelinJul 25, 2007
  24. Lars HjemliJul 25, 2007
  25. Johannes SchindelinJul 25, 2007
  26. Junio C HamanoJul 25, 2007
  27. Ricky NiteJul 25, 2007
  28. Junio C HamanoJul 25, 2007
  29. Sven VerdoolaegeJun 2, 2007
  30. Linus TorvaldsJun 2, 2007
  31. Sven VerdoolaegeJun 2, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.