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

JGit incorrectly reports changes detected when polling

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      Windows and Linux slaves running Jenkins 1.509.4, Git plugin 2.0, Git client plugin 1.4.5
    • Similar Issues:

      Description

      A Jenkins job configured with the Git plugin using the JGit implementation will execute the job at each polling interval, even when there were no changes on the git repository.

      The same job, configured with the Git plugin using the git command line implementation only executes the job when there were changes in the git repository.

      The problem is visible with both a git protocol repository and with a GitHub repository using the https protocol.

      Sample job definitions which show the problem are attached. The job definitions with "jgit" in the XML file name show the problem. The job definitions with "cli" in the XML file name do not show the problem.

      There is a simple work around for the problem. Add the "Force polling using workspace" to the job configuration through the "Additional Behaviours" section of the git plugin configuration for the job. That avoids the problem "ls-remote" in the JGit plugin implementation. Unfortunately, it also slows the polling process in those cases where the repository does not already exist

      Another work around is to remove wildcards from the branch name in the job definition. Unfortunately, that removes the ability to monitor multiple branches with a single Jenkins job.

        Attachments

          Activity

            People

            • Assignee:
              ndeloof Nicolas De Loof
              Reporter:
              markewaite Mark Waite
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: