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

            Hide
            markewaite Mark Waite added a comment - - edited

            Fixed in git client plugin 2.7.0

            Show
            markewaite Mark Waite added a comment - - edited Fixed in git client plugin 2.7.0
            Hide
            markewaite Mark Waite added a comment -

            See pull request 296 for changes to fix a regression reported as JENKINS-48818.

            Show
            markewaite Mark Waite added a comment - See pull request 296 for changes to fix a regression reported as JENKINS-48818 .
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark Waite
            Path:
            src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
            src/test/java/org/jenkinsci/plugins/gitclient/GitClientTest.java
            src/test/java/org/jenkinsci/plugins/gitclient/SubmodulePatternStringTest.java
            http://jenkins-ci.org/commit/git-client-plugin/69297552b3c36e084bea336448c6ad82763b303a
            Log:
            Fix both JENKINS-48818 and JENKINS-46054

            Add JENKINS-48818 test - space character in submodule remote name

            Submodule remote name which contains a space character was supported by
            git client plugin versions prior to 2.7.0. The bug fix for JENKINS-46054
            (support submodule update when the remote name or the remote URL end with
            '.url') broke support for submodule remote names which contain a space.

            This includes a test to show that a remote name containing a space
            character is not correctly handled by the 2.7.0 change.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java src/test/java/org/jenkinsci/plugins/gitclient/GitClientTest.java src/test/java/org/jenkinsci/plugins/gitclient/SubmodulePatternStringTest.java http://jenkins-ci.org/commit/git-client-plugin/69297552b3c36e084bea336448c6ad82763b303a Log: Fix both JENKINS-48818 and JENKINS-46054 Add JENKINS-48818 test - space character in submodule remote name Submodule remote name which contains a space character was supported by git client plugin versions prior to 2.7.0. The bug fix for JENKINS-46054 (support submodule update when the remote name or the remote URL end with '.url') broke support for submodule remote names which contain a space. This includes a test to show that a remote name containing a space character is not correctly handled by the 2.7.0 change.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark Waite
            Path:
            src/test/java/org/jenkinsci/plugins/gitclient/GitClientTest.java
            http://jenkins-ci.org/commit/git-client-plugin/88fa4fe6599aa71da5e1c5a7b6cb0c96160a88f5
            Log:
            Don't ignore the GitClientTest integration test of JENKINS-46054

            The integration test is an end to end verification of the bug,
            while the unit tests check more details of the specific parsing
            problem that was the root of the bug.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/test/java/org/jenkinsci/plugins/gitclient/GitClientTest.java http://jenkins-ci.org/commit/git-client-plugin/88fa4fe6599aa71da5e1c5a7b6cb0c96160a88f5 Log: Don't ignore the GitClientTest integration test of JENKINS-46054 The integration test is an end to end verification of the bug, while the unit tests check more details of the specific parsing problem that was the root of the bug.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark Waite
            Path:
            src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
            src/test/java/org/jenkinsci/plugins/gitclient/SubmodulePatternStringTest.java
            http://jenkins-ci.org/commit/git-client-plugin/2dcbb2d62a980468d339e52f4f8dd6653473d5cd
            Log:
            Merge pull request #296 from MarkEWaite/explore-JENKINS-46054

            Fix JENKINS-48818 and keep JENKINS-46054 fixed

            Compare: https://github.com/jenkinsci/git-client-plugin/compare/21914aaf97f0...2dcbb2d62a98

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java src/test/java/org/jenkinsci/plugins/gitclient/SubmodulePatternStringTest.java http://jenkins-ci.org/commit/git-client-plugin/2dcbb2d62a980468d339e52f4f8dd6653473d5cd Log: Merge pull request #296 from MarkEWaite/explore- JENKINS-46054 Fix JENKINS-48818 and keep JENKINS-46054 fixed Compare: https://github.com/jenkinsci/git-client-plugin/compare/21914aaf97f0...2dcbb2d62a98

              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: