jenkinsci / jenkinsci/git-plugin

[JENKINS-51434] Spurious builds using SCM polling and path whitelisting with git plugin

Open
#3,306 1 comment 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

Builds using SCM polling of a Git repo using Additional Behaviours / Included Regions results in spurious builds.

 

The build Changes shows that none of the changes apply to the paths configured in the Included Regions, but reviewing the Polling Log and then executing the git log command the Git  plugin uses to determine changes seems to show the cause.

The plugin uses git log --full-history --no-abbrev --format=raw -M -m --raw to determine what changed.  This not only includes merge commits, but in addition the -m flag  causes a full diff for the parents to be shown, causing previously processed commits to show up, some which may match the whitelist and result in a spurious build.

 

 

---
Originally reported by elevy, imported from: Spurious builds using SCM polling and path whitelisting with git plugin


  • status: Open
  • priority: Major
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 2
  • watchers: 2
  • imported: 2025-12-02

Raw content of original issue

Builds using SCM polling of a Git repo using Additional Behaviours / Included Regions results in spurious builds.

 

The build Changes shows that none of the changes apply to the paths configured in the Included Regions, but reviewing the Polling Log and then executing the git log command the Git  plugin uses to determine changes seems to show the cause.

The plugin uses git log --full-history --no-abbrev --format=raw -M -m --raw to determine what changed.  This not only includes merge commits, but in addition the -m flag  causes a full diff for the parents to be shown, causing previously processed commits to show up, some which may match the whitelist and result in a spurious build.
 

 

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.