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

Re: dependable submodules

From
Iin-gitvger@baka.org <in-gitvger@baka.org>
Date
Mar 22, 2011, 14:28 UTC
Message-ID
<201103221428.p2MESAkG018553@no.baka.org>
In-Reply-To
<AANLkTikv+Wf_nSt0GZj0WgPjpbk6Kr_WG-ueO6US9bUM@mail.gmail.com>

In message <AANLkTikv+Wf_nSt0GZj0WgPjpbk6Kr_WG-ueO6US9bUM@mail.gmail.com>, Dani el writes:

    I tried git-subtree. thanks but this is not what I wanted. This
    removed the .git dir for the subtree and hence updating the subtree is
    not easy.
    I want the functionality of git submodule except that I don't want the
    version checked in as part of the superproject to have to be fetched
    remotely.

Could "remotely" be a local shadow master? gitslave is another option to git-submodules and git subtree merge for provide a superproject with attached slaves, but like git submodules it does require fetching from "upstream". However, there is nothing requiring that "upstream" be the true Internet upstream. It could be a local shadow copy of the master. I describe this scenario in more detail on the gitslave home page starting with the third paragraph under "Gitslave is not perfect". I wrote this with gitslave in mind, but there is nothing stopping you from using the concept with git-submodules (aside from the pain of the submodule update pain added to the shadow repository update pain breeding).

However, if you really really have a good reason to want *everything* in one repo, perhaps you could play games with branches and subtree merge. For each slave repository, create a new branch with the content you want (or do a merge from the slave onto the new branch to get the history or whatever). Then attach the local repository to itself using git-submodules (bonus points if you can use a repository-relative URL), set the correct SHA corresponding to the branch of the "slave", and then (if it works, and I don't see why it would not) you are all done. I would hate to have to use and update such a repository, though.

					-Seth Robertson
Previous: Avery PennarunNext: Daniel
Message 9 of 11 in “dependable submodules”
  1. DanielMar 20, 2011
  2. Junio C HamanoMar 20, 2011
  3. DanielMar 20, 2011
  4. Jens LehmannMar 20, 2011
  5. DanielMar 20, 2011
  6. Robert PollakMar 21, 2011
  7. DanielMar 22, 2011
  8. Avery PennarunMar 22, 2011
  9. in-gitvger@baka.orgMar 22, 2011
  10. DanielMar 22, 2011
  11. Jens LehmannMar 22, 2011

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.