-
Bug
-
Resolution: Fixed
-
Major
-
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^
-> 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