-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Critical
-
Component/s: workflow-scm-step-plugin
-
None
the code logic in https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/GitSCM.java#L2040-L2058
Â
has a bug, it is not implementing the behavior described in https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/extensions/GitSCMExtension.java#L58-L60
Â
what should happen is, that the first extension that return true of false value is returned. only if the extension return null, other extensions should be check.
Â
but what actually happens is, that if a extension returns true. it will loop thru the other extensions, instead of returning the actual value.
Â
a possible fix for this, that fits the documented behavior could look like this:
Â
int idx=0; for (String line : revShow) { if (line.startsWith("commit ") && idx!=0) { boolean showEntireCommitSummary = GitChangeSet.isShowEntireCommitSummaryInChanges() || !(git instanceof CliGitAPIImpl); GitChangeSet change = new GitChangeSet(revShow.subList(start,idx), getExtensions().get(AuthorInChangelog.class)!=null, showEntireCommitSummary); Boolean excludeThisCommit=null; for (GitSCMExtension ext : extensions) { excludeThisCommit = ext.isRevExcluded(this, git, change, listener, buildData); if(excludeThisCommit!=null) return excludeThisCommit; } } idx++;
please review and check.
i marked this as critical, since it prevents exclusions form functioning.