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

Re: Submodule relative URL problems

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 13, 2014, 20:44 UTC
Message-ID
<xmqqppnv6294.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140113195518.GB18964@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
>  * More typical usage is to clone from a bare repository (A.git), which
>    wouldn't have this problem.  But I think your case is worth
>    supporting, too.

I think the relative URL among nested submodules was specifically designed for hosting environments that have forest of bare repositories to serve as publishing or meeting points. I personally do not know where that "worth supporting" comes from, but if the change can be done without confusing the codepaths involved, I wouldn't object too much ;-)

Show 6 quoted lines
>  * Perhaps as a special case when the superproject is foo/.git, git
>    should treat relative submodule paths as relative to foo/ instead
>    of relative to foo/.git/.  I think that would take care of your
>    case without breaking existing normal practices, though after the
>    patch is made it still wouldn't take care of people using old
>    versions of git without that patch.  What do you think?

If we were to start adding special cases, it may also be sensible to clean up the more normal case of using subdirectories of bare repositories to represent nestedness (i.e. you can have a submodule "logs.git", but not "logs"). We could reuse the $GIT_DIR/modules/$sm_name convention somehow perhaps?

Any change to implement the special case you suggest likely has to touch the same place as such a change does, as both require some reorganization of the code that traverses the pathnames to find related repositories.

Previous: Heiko Voigt
Message 4 of 4 in “Submodule relative URL problems”
  1. Lianheng TongJan 13, 2014
  2. Jonathan NiederJan 13, 2014
  3. Heiko VoigtJan 13, 2014
  4. Junio C HamanoJan 13, 2014

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.