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

Git plug-in & included regions : build not triggered in case of mutiple commits in one push.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • git-plugin
    • Debian

      I've been testing the Included regions feature for GitSCM plugin
      via SCM polling and Git hook.

      We are building only one branch : master.

      I could see that in some cases the jobs were not triggered whereas
      some changes have been made in files matching the included regions pattern.

      After some more testing I discovered that if several commits are made
      and pushed at the same time, only changes from the last commit is taken into account.

      Spying the git command the plugin is using I could see :

      git rev-parse --verify HEAD
      git command : fetch -t https://url.git +refs/heads/*:refs/remotes/
      origin/*
      git tag -l master
      git command : rev-parse origin/master^

      {commit}

      -> Gives the new SHA1
      git command : show --no-abbrev --format=raw -M --raw 'new sha1'

      The last command shows only diff from latest commit, should't it be
      something like :

      git show --no-abbrev --format=raw -M --raw 'old sha1'..'new sha1'

      'old sha1' being the sha1 of the latest build.

      I had a look at the source code of the git plugin and tried a patch.

      With the correction, the problem is not reproduced in my use case
      where I build only one branch.

      I put the patch as attachment.

      Jenkins 1.456
      Git Plugin 1.1.16

            ndeloof Nicolas De Loof
            blatinville Bertrand Latinville
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: