jenkinsci/git-plugin — pull request #181 by ojacobson (2013-11-29 19:14:01+00:00)
Title: [JENKINS-20607] Force commit downloads when filtering by commit attributes.

The new "fast polling" mechanism in git-2.0 does a hard build/no-build decision based solely on whether the remote branch tip is not/is equal to the last commit built on that branch. This works well in the simple case, but bypasses configurable checks such as "ignore commits from these users" or "ignore commits in these directories". It's possible for users to work around this by enabling the "force polling using workspace" option. However, the dependency isn't clear or documented (or, I suspect, well understood).

I've allowed `GitSCM` extensions such as `UserExclusion` and `PathRestriction` to individually tell `GitSCM` that they require a work tree to evaluate the restriction, and updated `GitSCM` to pay attention to these requirements rather than special-casing `DisableRemotePoll`. This feels more elegant to me; the user doesn't need to be aware of the dependency at all, and Jenkins doesn't need to "magically" add extra options. I believe this is compatible with existing git-2.0 and git-1.x configurations without any change to the stored configuration, to boot.

It's not clear to me how this interacts with JENKINS-10131. Better documentation of why the workspace requirement exists may be in order.