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

Re: [RFC] Submodules in GIT

From
SFStephan Feder <sf@b-i-t.de>
Date
Nov 30, 2006, 14:00 UTC
Message-ID
<456EE3F1.5070101@b-i-t.de>
In-Reply-To
<200611301255.41733.andyparkins@gmail.com>
Andy Parkins wrote:
Show 13 quoted lines
> On Thursday 2006 November 30 11:57, sf wrote:
> 
>> > Worse, if you allow that to happen, the supermodule can commit a state
>> > that cannot be retrieved from the submodule's repository.  The ONLY thing
>> > a supermodule can record about a submodule is a commit.
>>
>> So what? You have a submodule commit that only exists in the
>> supermodule. I fail to see the problem. The changes you made to the
>> submodule _in the supermodule_ can later be pulled from wherever you want.
> 
> Eh?  The files aren't stored in the supermodule, they're stored in the 
> submodule.  The ONLY thing in the supermodule is the commit hash.  The 
> objects for the submodule are still /in/ the submodule.

But you have got the submodule on your local disk anyway. So just setup alternates and the supermodule contains all of the submodule.

> It sounds like you're suggesting that the supermodule commit includes files 
> from the submodule?  How can that work?   The two aren't separate entities 
> then, it's just one big repository. 

It works as it always works in git: The supermodule commit contains the submodule commit, the submodule commit contains the submodule files, so the supermodule contains the submodule (at least the part of the submodule that is visible). It _must_ be one repository but it need not be big (once more, use alternates).

Show 7 quoted lines
> I mean, what would this supermodule commit look like?  Would it include a 
> commit message?  Which module should that commit message be about?  Should 
> the commit's parents be stored?  Which parents, the submodule HEAD or the 
> supermodule HEAD?  Which tree object should it link to?  The one in the 
> submodule doesn't exist, so it'll have to be a freshly made up one for the 
> supermodule - except now you've put submodule paths in the supermodule.  
> Nope.  That's never going to work.

Again I do not see the problem. Probably I have a much simpler picture of submodules: They are just commits in the supermodule's tree. Everything else follows naturally from how git currently behaves.

Of course it works. It is simple, it is the git way.
Am I missing the point?
Regards
Stephan
-- 
b.i.t.
beratungsgesellschaft für informations-technologie mbh
Stephan Feder
elisabethenstr. 62   fon: +49(0)6151/827575
64283 darmstadt      fax: +49(0)6151/827576
mailto:sf@b-i-t.de   www: http://www.b-i-t.de
Previous: Linus TorvaldsNext: Andy Parkins
Message 46 of 82 in “Re: [RFC] Submodules in GIT”
  1. Jakub NarebskiNov 20, 2006
  2. Martin WaitzNov 20, 2006
  3. Junio C HamanoNov 20, 2006
  4. Jakub NarebskiNov 20, 2006
  5. Martin WaitzNov 20, 2006
  6. Sam VilainNov 21, 2006
  7. Linus TorvaldsNov 20, 2006
  8. J. Bruce FieldsNov 20, 2006
  9. Martin WaitzNov 20, 2006
  10. J. Bruce FieldsNov 21, 2006
  11. Martin WaitzNov 21, 2006
  12. Martin WaitzNov 20, 2006
  13. Junio C HamanoNov 21, 2006
  14. Jakub NarebskiNov 21, 2006
  15. Martin WaitzNov 21, 2006
  16. Jakub NarebskiNov 21, 2006
  17. Martin WaitzNov 21, 2006
  18. Martin WaitzNov 21, 2006
  19. Junio C HamanoNov 21, 2006
  20. Martin WaitzNov 21, 2006
  21. Yann DirsonNov 21, 2006
  22. Linus TorvaldsNov 21, 2006
  23. Linus TorvaldsNov 21, 2006
  24. Yann DirsonNov 21, 2006
  25. Shawn PearceNov 22, 2006
  26. Yann DirsonNov 23, 2006
  27. Shawn PearceNov 25, 2006
  28. Yann DirsonNov 25, 2006
  29. Linus TorvaldsNov 25, 2006
  30. Steven GrimmNov 25, 2006
  31. Linus TorvaldsNov 25, 2006
  32. Yann DirsonNov 25, 2006
  33. Sven VerdoolaegeNov 26, 2006
  34. Yann DirsonNov 26, 2006
  35. Linus TorvaldsNov 26, 2006
  36. Daniel BarkalowNov 26, 2006
  37. Andreas EricssonNov 28, 2006
  38. Daniel BarkalowNov 28, 2006
  39. Sven VerdoolaegeNov 28, 2006
  40. Daniel BarkalowNov 28, 2006
  41. Sven VerdoolaegeNov 28, 2006
  42. Daniel BarkalowNov 28, 2006
  43. Shawn PearceNov 28, 2006
  44. Daniel BarkalowNov 28, 2006
  45. Linus TorvaldsNov 28, 2006
  46. Stephan FederNov 30, 2006
  47. Andy ParkinsNov 30, 2006
  48. Sven VerdoolaegeNov 30, 2006
  49. Andy ParkinsNov 30, 2006
  50. Andreas EricssonNov 30, 2006
  51. Andy ParkinsNov 30, 2006
  52. Sven VerdoolaegeNov 30, 2006
  53. Andy ParkinsDec 1, 2006
  54. Jakub NarebskiDec 1, 2006
  55. Sven VerdoolaegeDec 1, 2006
  56. Andy ParkinsDec 1, 2006
  57. Martin WaitzNov 30, 2006
  58. sfNov 30, 2006
  59. sfNov 30, 2006
  60. Andy ParkinsDec 1, 2006
  61. Martin WaitzDec 1, 2006
  62. Andy ParkinsDec 1, 2006
  63. Sven VerdoolaegeDec 1, 2006
  64. Andy ParkinsDec 1, 2006
  65. Sven VerdoolaegeDec 1, 2006
  66. sfDec 1, 2006
  67. Andy ParkinsDec 1, 2006
  68. Martin WaitzDec 1, 2006
  69. Andy ParkinsDec 1, 2006
  70. Martin WaitzDec 1, 2006
  71. Martin WaitzDec 1, 2006
  72. Andy ParkinsDec 1, 2006
  73. Martin WaitzDec 1, 2006
  74. Andy ParkinsDec 1, 2006
  75. Martin WaitzDec 1, 2006
  76. Martin WaitzDec 1, 2006
  77. Andy ParkinsDec 1, 2006
  78. Martin WaitzDec 1, 2006
  79. Jakub NarebskiDec 2, 2006
  80. Andy ParkinsDec 1, 2006
  81. Andreas EricssonDec 1, 2006
  82. Andy ParkinsDec 1, 2006

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.