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

Submodule update fails when the submodule isn't clean

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-client-plugin
    • None

      Jenkins doesn't forcibly update submodules. This means that a checkout can fail with:

      hudson.plugins.git.GitException: Command "git submodule update --init --recursive modules/gmock" returned status code 1:
      stdout: 
      stderr: error: Your local changes to the following files would be overwritten by checkout:
      build-aux/config.guess
      build-aux/config.sub
      gtest/build-aux/config.guess
      gtest/build-aux/config.sub
      Please, commit your changes or stash them before you can switch branches.
      Aborting
      Unable to checkout 'ec44c6c1675c25b9827aacd08c02433cccde7780' in submodule path 'modules/gmock'
      

      Note, while JENKINS-22510 is relevant, and cleaning the checkout before checking out would resolve the problem, that's not a viable solution. Cleaning the checkout throws away all built files, which means the build is no longer incremental.

      Note, this means the behaviour for submodules doesn't match it's behaviour for the standard checkout (which is checked out with --force).

          [JENKINS-55875] Submodule update fails when the submodule isn't clean

          Richard Whitehouse created issue -
          Richard Whitehouse made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Richard Whitehouse made changes -
          Description Original: Jenkins doesn't forcibly update submodules. This means that a checkout can fail with:


          {code:java}
          hudson.plugins.git.GitException: Command "git submodule update --init --recursive modules/gmock" returned status code 1:
          stdout:
          stderr: error: Your local changes to the following files would be overwritten by checkout:
          build-aux/config.guess
          build-aux/config.sub
          gtest/build-aux/config.guess
          gtest/build-aux/config.sub
          Please, commit your changes or stash them before you can switch branches.
          Aborting
          Unable to checkout 'ec44c6c1675c25b9827aacd08c02433cccde7780' in submodule path 'modules/gmock'
          {code}
          Note, while JENKINS-22510 is relevant, and cleaning the checkout before checking out would resolve the problem, that's not a viable solution. Cleaning the checkout throws away all built files, which means the build is no longer incremental.

          Note, this behaviour makes Jenkins's behaviour for submodules match it's behaviour for the standard checkout (which is checked out with --force).

           
          New: Jenkins doesn't forcibly update submodules. This means that a checkout can fail with:
          {code:java}
          hudson.plugins.git.GitException: Command "git submodule update --init --recursive modules/gmock" returned status code 1:
          stdout:
          stderr: error: Your local changes to the following files would be overwritten by checkout:
          build-aux/config.guess
          build-aux/config.sub
          gtest/build-aux/config.guess
          gtest/build-aux/config.sub
          Please, commit your changes or stash them before you can switch branches.
          Aborting
          Unable to checkout 'ec44c6c1675c25b9827aacd08c02433cccde7780' in submodule path 'modules/gmock'
          {code}
          Note, while JENKINS-22510 is relevant, and cleaning the checkout before checking out would resolve the problem, that's not a viable solution. Cleaning the checkout throws away all built files, which means the build is no longer incremental.

          Note, this means the behaviour for submodules doesn't match it's behaviour for the standard checkout (which is checked out with --force).

          Richard Whitehouse added a comment - https://github.com/jenkinsci/git-client-plugin/pull/404  has a fix for this issue.
          René Scheibe made changes -
          Remote Link New: This issue links to "git-client-plugin pr#404 (Web Link)" [ 24206 ]
          Mark Waite made changes -
          Remote Link New: This issue links to "PR 505 - replaces PR 404 and adds test (Web Link)" [ 24415 ]
          Mark Waite made changes -
          Component/s Original: git-plugin [ 15543 ]
          Mark Waite made changes -
          Status Original: In Progress [ 3 ] New: Open [ 1 ]

            richardwhiuk Richard Whitehouse
            richardwhiuk Richard Whitehouse
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: