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

Re: Nesting a submodule inside of another...

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 13, 2011, 22:44 UTC
Message-ID
<7v8vs16bst.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4E1E1672.7040503@web.de>
Jens Lehmann <Jens.Lehmann@web.de> writes:
> ... (at least when it concerns their work tree, the
> gitfile effort is trying to introduce some superproject awareness).
I don't think so.

The "gitfile effort" just makes it more convenient and potentially safer for superproject to remove submodule working tree by running an equivalent of "rm -fr submodule". The submodule shouldn't even care where its .git metadirectory is by looking at the "gitfile: " line, nor should it assume that location its .git metadirectory moved out of its working tree has some fixed relationship with its supermodule's repository. E.g. the superproject could choose to store it under $HOME/cache or /var/state as long as it knows where to point it back to after it runs "rm -rf submodule" and then it has to re-instantiate the submodule.

IOW, the superproject must be aware of that location, but submodule shouldn't depend on what convention the superproject chose to use. After all, there may not even be a superproject when gitfile is in use, so running "test -f .git" and assuming that it is used as a submodule of somebody else is already a bogus test.

Previous: Jens LehmannNext: John Szakmeister
Message 7 of 11 in “Nesting a submodule inside of another...”
  1. John SzakmeisterJul 12, 2011
  2. Jens LehmannJul 12, 2011
  3. John SzakmeisterJul 13, 2011
  4. Jens LehmannJul 13, 2011
  5. Junio C HamanoJul 13, 2011
  6. Jens LehmannJul 13, 2011
  7. Junio C HamanoJul 13, 2011
  8. John SzakmeisterJul 14, 2011
  9. Seth RobertsonJul 14, 2011
  10. John SzakmeisterJul 15, 2011
  11. Andreas EricssonJul 13, 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.