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

Git submodule fetch uses (incorrect) parent refspec

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      hudson 1.385, Hudson git plugin 1.1.3
    • Similar Issues:

      Description

      When using the "recursively update submodules" option, as well as a specific refspec, it tries to apply the same refspec when fetching changes for the submodule, causing spurious errors in the log:

      Checkout:test / /home/punkyb/hudson/amd64-lucid/workspace/test - hudson.remoting.Channel@61ae0436:slave-amd64-lucid
      Using strategy: Default
      Last Built Revision: Revision becbe8166b41940e842548f8dcc895ddafc67ceb (origin/release/1.2)
      Checkout:test / /home/punkyb/hudson/amd64-lucid/workspace/test - hudson.remoting.LocalChannel@23226fe1
      GitAPI created
      Fetching changes from the remote Git repository
      Fetching upstream changes from ssh://sourcecontrol/parent.git
      [test] $ git fetch -t ssh://sourcecontrol/parent.git/parent.git refs/heads/featurebranch
      [test] $ git ls-tree HEAD
      Trying to fetch submodule into /home/punkyb/hudson/amd64-lucid/workspace/test/submodule
      GitAPI created
      Fetching upstream changes from ssh://sourcecontrol/submodule.git
      [submodule] $ git fetch -t ssh://sourcecontrol/submodule.git refs/heads/featurebranch
      Problem fetching from submodule submodule - could be unavailable. Continuing anyway

        Attachments

          Activity

          Hide
          hvosdrecomm Hans Vos added a comment -

          It seems this problem has not yet been resolved. We are using Jenkins together with Git and Gerrit. We have a project with submodules defined in Git. When the Jenkins job is triggered by Gerrit it will also try to fetch the changes from the submodule repository. The following errors are shown in the console.

          Trying to fetch typo3_src into /var/lib/jenkins/jobs/example/workspace/typo3_src
          Fetching upstream changes from git://git.typo3.org/TYPO3v4/Core.git
          Problem fetching from submodule typo3_src - could be unavailable. Continuing anyway
          ERROR: (Underlying report) : Error performing command: git fetch -t git://git.typo3.org/TYPO3v4/Core.git refs/changes/98/4398/3
          Command "git fetch -t git://git.typo3.org/TYPO3v4/Core.git refs/changes/98/4398/3" returned status code 128: fatal: Couldn't find remote ref refs/changes/98/4398/3

          Show
          hvosdrecomm Hans Vos added a comment - It seems this problem has not yet been resolved. We are using Jenkins together with Git and Gerrit. We have a project with submodules defined in Git. When the Jenkins job is triggered by Gerrit it will also try to fetch the changes from the submodule repository. The following errors are shown in the console. Trying to fetch typo3_src into /var/lib/jenkins/jobs/example/workspace/typo3_src Fetching upstream changes from git://git.typo3.org/TYPO3v4/Core.git Problem fetching from submodule typo3_src - could be unavailable. Continuing anyway ERROR: (Underlying report) : Error performing command: git fetch -t git://git.typo3.org/TYPO3v4/Core.git refs/changes/98/4398/3 Command "git fetch -t git://git.typo3.org/TYPO3v4/Core.git refs/changes/98/4398/3" returned status code 128: fatal: Couldn't find remote ref refs/changes/98/4398/3
          Hide
          eanderson Eric Anderson added a comment -

          This just bit me too

          Show
          eanderson Eric Anderson added a comment - This just bit me too
          Hide
          jorgenpt Jørgen Tjernø added a comment -

          Just bit me too, I'm investigating a potential fix now.

          Show
          jorgenpt Jørgen Tjernø added a comment - Just bit me too, I'm investigating a potential fix now.
          Hide
          jorgenpt Jørgen Tjernø added a comment -

          Fix (pending verification) lives at https://github.com/jenkinsci/git-plugin/pull/96

          Show
          jorgenpt Jørgen Tjernø added a comment - Fix (pending verification) lives at https://github.com/jenkinsci/git-plugin/pull/96
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jørgen P. Tjernø
          Path:
          src/main/java/hudson/plugins/git/GitSCM.java
          http://jenkins-ci.org/commit/git-plugin/6c2e0bdc7b33760f67a481a0cf9935ebc245e3b9
          Log:
          JENKINS-8149 Fix submodule refspec.

          This switches from using the parent repository's refspec to using the
          commit specified in the index. We will now use the correct refspec when
          fetching submodules.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jørgen P. Tjernø Path: src/main/java/hudson/plugins/git/GitSCM.java http://jenkins-ci.org/commit/git-plugin/6c2e0bdc7b33760f67a481a0cf9935ebc245e3b9 Log: JENKINS-8149 Fix submodule refspec. This switches from using the parent repository's refspec to using the commit specified in the index. We will now use the correct refspec when fetching submodules.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jørgen P. Tjernø
          Path:
          src/main/java/hudson/plugins/git/GitSCM.java
          http://jenkins-ci.org/commit/git-plugin/8642f269754b90b6b5e01249d0292f3f90ad1458
          Log:
          Merge pull request #96 from jorgenpt/fix-refspec-in-submodule-fetch

          JENKINS-8149 Fix submodule refspec.

          Compare: https://github.com/jenkinsci/git-plugin/compare/cb3b1c0e0b0e...8642f269754b

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jørgen P. Tjernø Path: src/main/java/hudson/plugins/git/GitSCM.java http://jenkins-ci.org/commit/git-plugin/8642f269754b90b6b5e01249d0292f3f90ad1458 Log: Merge pull request #96 from jorgenpt/fix-refspec-in-submodule-fetch JENKINS-8149 Fix submodule refspec. Compare: https://github.com/jenkinsci/git-plugin/compare/cb3b1c0e0b0e...8642f269754b
          Hide
          yhwan Evan Wan added a comment -

          how to set submodule's refspec, such as gerrit changes in submodule "refs/changes/:refs/changes"?

          Show
          yhwan Evan Wan added a comment - how to set submodule's refspec, such as gerrit changes in submodule "refs/changes/ :refs/changes "?

            People

            • Assignee:
              jorgenpt Jørgen Tjernø
              Reporter:
              ccutrer Cody Cutrer
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: