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

Re: Submodule using different repository URLs

From
Johan Herland <johan@herland.net>
Date
Jul 13, 2009, 12:28 UTC
Message-ID
<200907131428.43652.johan@herland.net>
In-Reply-To
<64652870-CF95-49A7-920A-0F9A6C202B40@petervoss.org>
On Monday 13 July 2009, Peter Voss wrote:
Show 14 quoted lines
> On 13.07.2009, at 12:59, Johan Herland wrote:
> > You might be able to pull this off using relative submodule URLs.
>
> That's a good hint. Unfortunately I can't use this to go up 2
> directories. I.e. I can't get from
> git@github.com:xxx/mymodule.git
> to
> git@github.com:yyy/foo.git
>
> Using the relative URL ../../yyy/foo.git leads to the result:
> Clone of 'git@github.com:xxx/yyy/foo.git' into submodule path 'foo'
> failed
>
> So I basically cannot replace the xxx part.

This is due to a small bug in git-submodule.sh. In the resolve_relative_url() function, when repeatedly unwrapping '../'s from $url in the while loop, the line remoteurl="${remoteurl%/*}" removes everything _after_ the last slash, which does not work for the git@github.com:xxx part of your URL.

This should be relatively easy to fix, although maybe not as straightforwardly trivial as it might seem at first sight.

I don't have the time to look into this now, so feel free to take a stab at it.

Have fun! :)
...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: Peter VossNext: Johan Herland
Message 6 of 8 in “Submodule using different repository URLs”
  1. Peter VossJul 13, 2009
  2. Santi BéjarJul 13, 2009
  3. Peter VossJul 13, 2009
  4. Johan HerlandJul 13, 2009
  5. Peter VossJul 13, 2009
  6. Johan HerlandJul 13, 2009
  7. Johan HerlandJul 13, 2009
  8. Peter VossJul 13, 2009

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.