[go: up one dir, main page]

Skip to content

Allow full path URL for submodules on same server but with protocol matching clone

Currently, the recommended way to use submodules is:

  • use relative URLs in your .gitmodules file when your submodule is on the same GitLab server, and
  • use the full URL for submodules not located on the same GitLab server.

In our organisation, we can have multiple copies of a given repository using submodules but we don't always need to copy the linked submodules, and would rather point to the same project as the original repository. When using the relative URL scheme, however, the links are often broken because the level under which the copy/fork is made isn't the same relative to the submodule. It's possible to use a full URL but that creates problem when mixing protocols.

Proposal: enable usage of full-URL scheme without protocol, like in the example below, in which case the protocol used is the same as that used to clone the top-level project.

Example (with both projects on gitlab.com):

[submodule "project"]
  path = project
  url = //gitlab.com/group/project.git

(rather than the form

[submodule "project"]
  path = project
  url = ../../group/project.git

)

I'm sorry if this proposal was already made elswhere but I couldn't quickly find it by search.

Thanks, Karolos

Edited by 🤖 GitLab Bot 🤖