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

Re: .gitlink for Summer of Code

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 27, 2007, 17:04 UTC
Message-ID
<Pine.LNX.4.64.0703270952020.6730@woody.linux-foundation.org>
In-Reply-To
<200703270117.59205.Josef.Weidendorfer@gmx.de>
On Tue, 27 Mar 2007, Josef Weidendorfer wrote:
Show 11 quoted lines
> On Tuesday 27 March 2007, Junio C Hamano wrote:
> > Martin Waitz <tali@admingilde.org> writes:
> > 
> > > For submodules I currently use <parent>/.git/objects/module/<submodule>/
> > > to store the objects belonging to the submodule.
> > 
> > I was not following the gitlink discussion closely, but what is
> > the motivation behind this separation of the object store?
> 
> The separation issue is about scalability of submodules, and not
> directly about gitlink.
NOTE! It's fine to share the *object*store* for a supermodule setup.

The scalability concerns are not about the number of objects, but about the operations that work on them, and specifically *traverse* the objects.

So while it's fine to share the same GIT_OBJECT_DIR for all the submodules, it's *not* ok if "git clone" on a supermodule will consider things to be one single repository, and clone it as one huge thing, generating (and having to look up!) a ten-million object pack for a hundred smaller projects. THAT won't scale.

Basically, a "git-rev-list --objects HEAD" in the super-module should only list the objects in the supermodule itself, not in all the submodules. And that implies that cloning a supermodule is not about cloning a single big repository: it would be a matter of:

 - first cloning first the supermodule itself (which is often fairly 
   small: just a top-level directory, with some top-level Makefiles and a 
   number of directories that are submodules)
 - then parsing some supermodule data structure, and cloning each 
   submodule individually.

Similarly for "fetch" (and merging too, of course - it ends up having to merge each sub-project separately).

Think of it this way: if you think people find it a bit annoying that you currently have to get all the history when you do clone (and why people have worked on "shallow clones" in git), imagine just *how* frustrating it is if you have to get all five-hundred subprojects when you only want to work on one small one!

Think of something like a huge *BSD "world" tree, where the supermodule contains *everything*. Do you really _really_ expect that every single developer wants to clone it all? I have no idea how much that is, but I can well imagine that it's several thousand subprojects, some of which are quite big in their own right.

Also, imagine the server side.. Anybody who thinks that the server wants to (or is even *able* to) do things like a fsck on the totality, or keep every single object in memory, is in for a nasty surprise..

So I think that:
 - sharing object directories should not be a requirement, but it should 
   certainly be *possible*. Quite often you might want to do it, although 
   for really big superprojects it might well make sense to have 
   individual object stores too.
 - walking the *global* object list is simply not possible. You need to 
   fsck every single subtree individually, and fsck the superproject on 
   its own, *without* recursing into the subprojects. And you need to be 
   able to clone the superproject and only one or two subprojects, and 
   never see it as one "atomic" big repository.

I really think people should think about the *BSD kind of "world" setup. You absolutely do _not_ want supermodules to be indivisible "everything or nothign" kind of things. You want submodules to be very much separate repostories, although you *can* of course share the object store if you want to (the same way git can do it between any number of totally unrelated repositories!)

		Linus
Previous: Junio C HamanoNext: David Lang
Message 42 of 61 in “.gitlink for Summer of Code”
  1. Eric LeshMar 25, 2007
  2. Matthieu MoyMar 25, 2007
  3. Shawn O. PearceMar 25, 2007
  4. Johannes SchindelinMar 25, 2007
  5. Shawn O. PearceMar 25, 2007
  6. Junio C HamanoMar 25, 2007
  7. Shawn O. PearceMar 25, 2007
  8. Petr BaudisMar 27, 2007
  9. Eric LeshMar 26, 2007
  10. Matthieu MoyMar 26, 2007
  11. Eric LeshMar 26, 2007
  12. Martin WaitzMar 26, 2007
  13. Josef WeidendorferMar 26, 2007
  14. Matthieu MoyMar 26, 2007
  15. Josef WeidendorferMar 26, 2007
  16. Matthieu MoyMar 27, 2007
  17. Martin WaitzMar 26, 2007
  18. Junio C HamanoMar 26, 2007
  19. Submodule object storeMartin Waitz, Mar 26, 2007
  20. Junio C HamanoMar 26, 2007
  21. Martin WaitzMar 26, 2007
  22. David LangMar 26, 2007
  23. Martin WaitzMar 26, 2007
  24. David LangMar 26, 2007
  25. Martin WaitzMar 27, 2007
  26. David LangMar 27, 2007
  27. Junio C HamanoMar 27, 2007
  28. Martin WaitzMar 27, 2007
  29. Uwe Kleine-KönigMar 27, 2007
  30. Uwe Kleine-KönigMar 27, 2007
  31. Martin WaitzMar 27, 2007
  32. Josef WeidendorferMar 27, 2007
  33. Martin WaitzMar 27, 2007
  34. Uwe Kleine-KönigMar 27, 2007
  35. Linus TorvaldsMar 27, 2007
  36. Uwe Kleine-KönigMar 27, 2007
  37. Linus TorvaldsMar 27, 2007
  38. Linus TorvaldsMar 27, 2007
  39. Martin WaitzMar 27, 2007
  40. Josef WeidendorferMar 26, 2007
  41. Junio C HamanoMar 26, 2007
  42. Linus TorvaldsMar 27, 2007
  43. David LangMar 27, 2007
  44. Linus TorvaldsMar 27, 2007
  45. Martin WaitzMar 27, 2007
  46. Daniel BarkalowMar 27, 2007
  47. Linus TorvaldsMar 27, 2007
  48. Daniel BarkalowMar 27, 2007
  49. Linus TorvaldsMar 27, 2007
  50. David LangMar 27, 2007
  51. Jakub NarebskiMar 27, 2007
  52. David LangMar 27, 2007
  53. Steven GrimmMar 27, 2007
  54. Daniel BarkalowMar 27, 2007
  55. Linus TorvaldsMar 27, 2007
  56. Josef WeidendorferMar 26, 2007
  57. Martin WaitzMar 26, 2007
  58. Jakub NarebskiMar 26, 2007
  59. Matthieu MoyMar 26, 2007
  60. Jakub NarebskiMar 27, 2007
  61. Shawn O. PearceMar 25, 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.