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

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

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jun 1, 2007, 16:29 UTC
Message-ID
<alpine.LFD.0.98.0706010919360.3957@woody.linux-foundation.org>
In-Reply-To
<8c5c35580706010856s390b1157p3ea0d28cb2074cae@mail.gmail.com>
On Fri, 1 Jun 2007, Lars Hjemli wrote:
Show 7 quoted lines
> On 6/1/07, Sven Verdoolaege <skimo@kotnet.org> wrote:
> > 
> > Hmm.... I was thinking that the extra "path" level could be optional,
> > i.e., if there is no path.$path.submodule, then the name of the
> > submodule would simply be $path.
> 
> Yeah, that should also work out. Time for a quick poll?

Ack. I think the natural thing for a lot of cases is the trivial "module name == path" case, so having to have

	[path "kernel"]
		module = kernel
for that case just sounds unnecessary.

That said, I wonder if it wouldn't be more natural to do things the other way around, because quite often a "module" (under CVS conventions) is a *set* of directories, so with that in mind, it might be better to have the mapping be something like this:

	[module "infrastructure"]
		submodule = lib
		submodule = build
	[submodule "lib"]
		url = git://xyzzy/lib-1.2.3
	[submodule "build"]
		url = git://xyzzy/build-0.61
and make the rule be:
 - submodules are named by their paths (ie "path == submodule")
 - a module is a set of such submodules/paths
 - if no "module" is defined, the default is to just use the 
   path/submodule name
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")
and when you do a 
	git submodule checkout infrastructure
it would be basically equivalent to
	git submodule checkout lib
	git submodule checkout build

Hmm? That's how CVS users use modules (ie the "src" module may be much more than a single subdirectory)

		Linus
Previous: Lars HjemliNext: Junio C Hamano
Message 12 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.