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

Re: Composing git repositories

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Mar 27, 2013, 11:49 UTC
Message-ID
<CALkWK0kNH2A4eLML22RTofarR3MB++OECiNXMi-bWLLMWK1GAg@mail.gmail.com>
In-Reply-To
<7vmwtqt8rs.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 7 quoted lines
> So you have to stash it somewhere.  We could have made it to move
> them to $HOME/.safeplace or somewhere totally unrelated to the
> superproject.  So in that sense, the repositories are *not* owned by
> the superproject in any way.  However, you are working within the
> context of the superproject on the submodule after all, and
> somewhere under $GIT_DIR/ of the superorject is not too wrong a
> place to use as such a safe place.

Thanks for the explanation. The paths in .git/modules are unnecessary ugly and unwieldy, especially in the case of multiple levels of nesting: I'll look into converting it to a flat structure using <repository name>.git, while handling name conflicts. I'll also look into adding a feature to relocate this/ using an object store from an existing clone.

> Look for floating submodules in the list archive.
The most relevant message thread I could find was [1], back from 2011.
 You argue that floating submodules are Wrong, and that there is no
real usecase for it.

Like I explained earlier, I'm looking at one tool that solves a superset of the problems mr, repo, submodules, subtrees, and other tools solve. I really like the way repo allows me to work on a meta project like Android or ChromiumOS, but hate that it allows for zero composition.

To move forward, I have the following design thoughts (elaborating on my previous email):

1. If .gitmodules is tracked like a normal file, it is absolutely
impossible to tell the possible dependencies of the superproject
without cloning it entirely, and looking at the .gitmodules file in
each of the branches.  Can't we have it as a special ref instead, so I
can `git fetch` just that ref to figure out the dependencies?
2. True composition requires that I be able to specify the entire
manifest (for nested submodules) in the toplevel .gitmodules, or break
it up as I see fit.  This is currently impossible, and brings us back
to #1: the manifest for b/, b/c are in the toplevel repo's special
ref, and I need to fetch c's special ref to figure out what d is (or
error out if no such thing exists).
3. True floating submodules are impossible, because a change in the
submodule means a change in the commit object referenced by the
superproject's tree object; diff-tree will see that some content has
changed in the repository.  We can represent that diff however we want
(using diff.submodule), but we can't change the fact that the change
has to be committed.  Fixing this will require nothing short of
introducing a new kind of object (say "submodule" object which can be
a concrete SHA-1 or point to a ref).

Do you think thinking about these things is worthwhile? I see more complaints like [2] as git adoption in the industry increases, but we have no solution: we can't make git scale to super-large repositories, and we have no real way to compose smaller repositories. Hacks like repo sadden me.

[1]: http://thread.gmane.org/gmane.comp.version-control.git/185164 [2]: http://thread.gmane.org/gmane.comp.version-control.git/189776

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 43 in “Composing git repositories”
  1. Ramkumar RamachandraMar 26, 2013
  2. Junio C HamanoMar 26, 2013
  3. Ramkumar RamachandraMar 27, 2013
  4. Junio C HamanoMar 27, 2013
  5. Ramkumar RamachandraMar 27, 2013
  6. Junio C HamanoMar 27, 2013
  7. Jonathan NiederMar 27, 2013
  8. Junio C HamanoMar 27, 2013
  9. Jonathan NiederMar 27, 2013
  10. Ramkumar RamachandraMar 28, 2013
  11. Jens LehmannMar 28, 2013
  12. Ramkumar RamachandraMar 28, 2013
  13. Jonathan NiederMar 28, 2013
  14. Jens LehmannMar 28, 2013
  15. Jens LehmannMar 27, 2013
  16. Ramkumar RamachandraMar 28, 2013
  17. Jens LehmannMar 28, 2013
  18. Ramkumar RamachandraMar 31, 2013
  19. Jonathan NiederMar 31, 2013
  20. Ramkumar RamachandraApr 2, 2013
  21. Jeff KingApr 2, 2013
  22. Ramkumar RamachandraApr 2, 2013
  23. Jens LehmannApr 2, 2013
  24. Junio C HamanoApr 2, 2013
  25. Junio C HamanoApr 4, 2013
  26. Duy NguyenApr 5, 2013
  27. Junio C HamanoApr 5, 2013
  28. Duy NguyenApr 5, 2013
  29. Jens LehmannApr 5, 2013
  30. Phil HordMar 31, 2013
  31. Jens LehmannApr 1, 2013
  32. Phil HordApr 1, 2013
  33. Ramkumar RamachandraApr 2, 2013
  34. Jonathan NiederApr 2, 2013
  35. Junio C HamanoApr 2, 2013
  36. Ramkumar RamachandraApr 2, 2013
  37. Jonathan NiederApr 2, 2013
  38. Ramkumar RamachandraApr 2, 2013
  39. Ramkumar RamachandraApr 2, 2013
  40. Jens LehmannApr 2, 2013
  41. Jens LehmannApr 1, 2013
  42. Seth RobertsonApr 1, 2013
  43. Ramkumar RamachandraApr 2, 2013

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.