Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46054

Unable to pull submodules that contain ".url" in the url

    Details

    • Similar Issues:

      Description

      git-client-plugin fetches the list of submodules using:

      git config -f .gitmodules --get-regexp "^submodule\\.(.*)\\.url"
      

      Which returns entries in the form:

      submodule.<name>.url <value>
      

      It then uses

      "Pattern.compile("^submodule\\.(.*)\\.url", Pattern.MULTILINE)"
      

      to extract the module name (CliGitAPIImpl.java#L1062).

      I have a thirdparty submodule called "urlesc" that lives in a repo that looks something like:

      submodule.src/git.repo.local/urlesc.url git.repo.local:/gitroot/thirdparty.urlesc.git

      If the value contains ".url" the regex will match too much of the line.

      It thinks the name is "src/git.repo.local/urlesc.url git.repo.local:/gitroot/thirdparty" and so tries to run:

      git config --get "submodule.src/git.repo.local/urlesc.url git.repo.local:/gitroot/thirdparty.url"
      

      which is incorrect.

      The regex should be something like

      "^submodule\\.(.*)\\.url "
      

      (note the space after url) or

      "^submodule\\.([^ ]*)\\.url"
      

      .

        Attachments

          Issue Links

            Activity

            gfranklin Greg Franklin created issue -
            gfranklin Greg Franklin made changes -
            Field Original Value New Value
            Description git-client-plugin fetches the list of submodules using:

            git config -f .gitmodules --get-regexp "^submodule\\.(.*)\\.url"

            Which returns entries in the form:

            submodule.<name>.url <value>

            It then uses "Pattern.compile("^submodule\\.(.*)\\.url", Pattern.MULTILINE)" to extract the module name (CliGitAPIImpl.java#L1062).

            I have a thirdparty submodule called "urlesc" that lives in a repo that looks something like:

            submodule.src/git.repo.local/urlesc.url git.repo.local:/gitroot/thirdparty.urlesc.git

            If the value contains ".url" the regex will match too much of the line.

            It thinks the name is "src/git.repo.local/urlesc.url git.repo.local:/gitroot/thirdparty" and so tries to run:

            git config --get "submodule.src/git.repo.local/urlesc.url git.repo.local:/gitroot/thirdparty.url"

            which is incorrect.

            The regex should be something like "^submodule\\.(.*)\\.url " (note the space after url) or "^submodule\\.([^ ]*)\\.url".
            git-client-plugin fetches the list of submodules using:

            {noformat}
            git config -f .gitmodules --get-regexp "^submodule\\.(.*)\\.url"
            {noformat}


            Which returns entries in the form:

            {noformat}
            submodule.<name>.url <value>
            {noformat}

            It then uses
            {noformat}
            "Pattern.compile("^submodule\\.(.*)\\.url", Pattern.MULTILINE)"
            {noformat}
             to extract the module name (CliGitAPIImpl.java#L1062).

            I have a thirdparty submodule called "urlesc" that lives in a repo that looks something like:

            submodule.src/git.repo.local/urlesc.url git.repo.local:/gitroot/thirdparty.urlesc.git

            If the value contains ".url" the regex will match too much of the line.

            It thinks the name is "src/git.repo.local/urlesc.url git.repo.local:/gitroot/thirdparty" and so tries to run:


            {noformat}
            git config --get "submodule.src/git.repo.local/urlesc.url git.repo.local:/gitroot/thirdparty.url"
            {noformat}


            which is incorrect.

            The regex should be something like
            {noformat}
            "^submodule\\.(.*)\\.url "
            {noformat}
             (note the space after url) or
            {noformat}
            "^submodule\\.([^ ]*)\\.url"
            {noformat}
            .
            markewaite Mark Waite made changes -
            Assignee Mark Waite [ markewaite ]
            markewaite Mark Waite made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            markewaite Mark Waite made changes -
            Assignee Mark Waite [ markewaite ]
            markewaite Mark Waite made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            markewaite Mark Waite made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            markewaite Mark Waite made changes -
            Link This issue is related to JENKINS-48818 [ JENKINS-48818 ]
            markewaite Mark Waite made changes -
            Link This issue is related to JENKINS-48997 [ JENKINS-48997 ]

              People

              • Assignee:
                markewaite Mark Waite
                Reporter:
                gfranklin Greg Franklin
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: