git submodule link on Bitbucket sources page doesn't work when url in .gitmodules is relative

Issue #12521 open
Ryan Salt
created an issue


As a user, when I change the 'url' field in my repositories .gitmodules file to be relative, rather than absolute, the link to the associated submodule within the Bitbucket source view page is no longer active and is replaced by a text representation. Attached screenshots, and here is a diff as an example of the .gitmodules change to stimulate the issue:

[submodule "communis"]
        path = communis
-       url =
+       url = ../communis.git

Suggested solution:

Whatever parses the .gitmodules file, for the purposes of presenting the user with a link to the associated submodule, should be modified to understand relative paths and behave in the same way as it would if the 'url' field was absolute. NOTE: If there is a problem resolving the relative link, the current operation is acceptable, but I don't believe there is a problem in the case I'm reporting as git performs a recursive clone quite happily with the relative url I supplied. See gitmodules documentation for info.

Comments (4)

  1. Tim Nordell


    Another good reason for folks to utilize relative URLs is that:

    1. A user can clone using SSH or HTTPS and the same method will be used to clone submodules
    2. If someone were to clone our public repositories into a private server, the relative links would cause folks cloning from the private server to also clone the submodules from the private server
  2. Log in to comment