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

Re: Relative submodule URLs vs. clone URL DWIMming

From
Mark Levedahl <mlevedahl@gmail.com>
Date
Aug 28, 2008, 14:50 UTC
Message-ID
<48B6BB49.3000703@gmail.com>
In-Reply-To
<200808271400.54302.johan@herland.net>
Johan Herland wrote:
Show 11 quoted lines
>
> I'd like to fix this, but I'm not sure whether the fix belongs in 
> builtin-clone.c (i.e. making sure the origin URL is always "correct" 
> wrt. resolving relative submodule URLs), or in git-submodule.sh (i.e. 
> adding smarts when resolving relative submodule URLs against the 
> super-repo's origin URL).
>
>
> ...Johan
>
>   

I think the right approach is to start with clone and make it record the real url it is using, regardless of what was input. The problem with doing this in submodule is that in effect this replicates the search logic clone would use, and furthermore could lead to nasty surprises by grabbing the wrong submodule in an extreme case of having two identically named repositories in different locations on a server.

I was about to create a patch for submodule to always remove trailing "/.git" before resolving, but in fact a user could put the submodule .git into the superproject's .git, in a non-bare repository, and then gitlink that in the checked out submodule. So, it may also be good to define and enforce rules on how relative url naming can be used for this purpose. So far, I have only used it for bare repositories using the "../<path> form keeping the submodules out of the superproject.

Mark
Previous: Johan HerlandNext: Johan Herland
Message 2 of 8 in “Relative submodule URLs vs. clone URL DWIMming”
  1. Johan HerlandAug 27, 2008
  2. Mark LevedahlAug 28, 2008
  3. Johan HerlandAug 28, 2008
  4. Junio C HamanoAug 30, 2008
  5. Johan HerlandAug 30, 2008
  6. Junio C HamanoAug 30, 2008
  7. Bring local clone's origin URL in line with that of a remote cloneJohan Herland, Sep 1, 2008
  8. Junio C HamanoSep 2, 2008

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.