Skip to content
Browse files
Switch to ignore post-commit hook in SCM polling triggers [FIXED JENK…
  • Loading branch information
kutzi committed Nov 24, 2012
1 parent 41f1fe6 commit b65c30cb368e79205edacd958d8fd98dd89f3a73
@@ -58,6 +58,10 @@
<li class=bug>
Slave's Name should be trimmed of spaces at the beginning and end of the Name on Save.
(<a href="">issue 15836</a>)
<li class=rfe>
Added new switch to ignore post-commit hooks in SCM polling triggers.
This requires that the SCM plugin supports this feature, too!
(<a href="">issue 6846</a>)

@@ -73,9 +73,28 @@
* @author Kohsuke Kawaguchi
public class SCMTrigger extends Trigger<SCMedItem> {

private boolean ignorePostCommitHooks;

public SCMTrigger(String scmpoll_spec) throws ANTLRException {
this(scmpoll_spec, false);

public SCMTrigger(String scmpoll_spec, boolean ignorePostCommitHooks) throws ANTLRException {
this.ignorePostCommitHooks = ignorePostCommitHooks;

* This trigger wants to ignore post-commit hooks.
* <p>
* SCM plugins must respect this and not run this trigger for post-commit notifications.
* @since 1.493
public boolean isIgnorePostCommitHooks() {
return this.ignorePostCommitHooks;

@@ -27,4 +27,7 @@ THE SOFTWARE.
<f:entry title="${%Schedule}" help="/descriptor/hudson.triggers.TimerTrigger/help/spec">
<f:textarea name="scmpoll_spec" checkUrl="'${rootURL}/trigger/TimerTrigger/check?value='+encodeURIComponent(this.value)" value="${instance.spec}"/>
<f:entry field="ignorePostCommitHooks" title="${%Ignore post-commit hooks}">
<f:checkbox />
@@ -0,0 +1,8 @@
Ignore changes notified by SCM post-commit hooks.
This can be useful if you want to prevent some long-running jobs (e.g. reports) starting because of every commit, but still want to
run them periodic if SCM changes have occurred.
Note that this option needs to be supported by the SCM plugin, too! The subversion-plugin supports this since version 1.44.

0 comments on commit b65c30c

Please sign in to comment.