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

Re: git submodules implementation question

From
USUma Srinivasan <usrinivasan@twitter.com>
Date
Aug 29, 2016, 21:13 UTC
Message-ID
<CAN5XQfty6Fshzf6kN7eXhFekU9+=VPwbzEPN1a92yVB=9nm0Vg@mail.gmail.com>
In-Reply-To
<CAPc5daVhY6WdHkXGLYea48uOw0-rTzLLZ=7mNo=VPebZ9AG4jQ@mail.gmail.com>
Ok that makes sense. Thanks much.
Uma
On Mon, Aug 29, 2016 at 2:09 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 28 quoted lines
> On Mon, Aug 29, 2016 at 2:03 PM, Uma Srinivasan <usrinivasan@twitter.com> wrote:
>> On Mon, Aug 29, 2016 at 1:03 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>>
>>> A top-level superproject can have a submodule bound at its "dir/"
>>> directory, and "dir/.git" can either be a gitfile which you can read
>>> with read_gitfile() and point into somewhere in ".git/modules/" of
>>> the top-level superproject.  "dir/.git" can _ALSO_ be a fully valid
>>> Git directory.  So at the top of a superproject, you could do
>>>
>>>         git clone $URL ./dir2
>>>         git add dir2
>>>
>>> to clone an independent project into dir2 directory, and add it as a
>>> new submodule.  The fallback is to support such a layout.
>>>
>> Thanks for the reply. However, in this case....
>>
>>       git clone $URL ./dir2
>>       git add dir2
>>
>> how will "dir2" get ever get registered as a submodule?
>
> With a separate invocation of "git config -f .gitmodules", of course.
> The layout to use gitfile to point into .git/modules/ is a more recent
> invention than the submodule support itself that "git add" knows about.
> The code needs to support both layout as well as it can, and that
> is what the "can we read it as gitfile?  If not, that directory itself may
> be a git repository" codepath you asked about is doing.
Previous: Junio C HamanoNext: Uma Srinivasan
Message 5 of 31 in “git submodules implementation question”
  1. Uma SrinivasanAug 28, 2016
  2. Junio C HamanoAug 29, 2016
  3. Uma SrinivasanAug 29, 2016
  4. Junio C HamanoAug 29, 2016
  5. Uma SrinivasanAug 29, 2016
  6. Uma SrinivasanAug 29, 2016
  7. Junio C HamanoAug 29, 2016
  8. Uma SrinivasanAug 29, 2016
  9. Jacob KellerAug 30, 2016
  10. Uma SrinivasanAug 30, 2016
  11. Jacob KellerAug 30, 2016
  12. Jacob KellerAug 30, 2016
  13. Uma SrinivasanAug 30, 2016
  14. Junio C HamanoAug 30, 2016
  15. Uma SrinivasanAug 31, 2016
  16. Junio C HamanoAug 31, 2016
  17. Uma SrinivasanAug 31, 2016
  18. Junio C HamanoAug 31, 2016
  19. Uma SrinivasanAug 31, 2016
  20. Uma SrinivasanSep 1, 2016
  21. Junio C HamanoSep 1, 2016
  22. Uma SrinivasanSep 1, 2016
  23. Junio C HamanoSep 1, 2016
  24. Stefan BellerSep 1, 2016
  25. Junio C HamanoSep 1, 2016
  26. Junio C HamanoSep 1, 2016
  27. Junio C HamanoSep 1, 2016
  28. Stefan BellerSep 1, 2016
  29. Junio C HamanoSep 1, 2016
  30. Uma SrinivasanSep 1, 2016
  31. Junio C HamanoSep 1, 2016

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.