-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
GIT Plugin 4.5.2, Jenkins 2.222.4
- add a message "Polling ignores commits with certain messages"
.*\[maven-release-plugin\].*
- commit with this message - polling doesn't ignore the message
- Reason: the commit message string contains a final line break (commits I created locally, commits that are created on Jenkins host with CentOS)
- Analysis: I added some lines with listener.getLogger().println("[ABC] ...") to src/main/java/hudson/plugins/git/extensions/impl/MessageExclusion.java
- Polling Log showed me that the message contains a line break that doesn't match with pattern - empty line in polling log:
[ABC] Checking commit 4b22f7aacbf22359c46adbdf20b04c09cf8b890e: Found message [maven-release-plugin] [ABC] >> excludedMessage: [.*\[maven-release-plugin\].*] [ABC] >>>> Pattern IS set: .*\[maven-release-plugin\].* [ABC] >> acceptedMessage: [[maven-release-plugin] ]
- Fix: I changed the following line in src/main/java/hudson/plugins/git/extensions/impl/MessageExclusion.java:
// old line that doesnt ignore the message excludedPattern = Pattern.compile(excludedMessage); // new line that works with the final line break excludedPattern = Pattern.compile(excludedMessage, Pattern.DOTALL);
As I'm not a software developer, I'm not sure about side effects when adding Pattern.DOTALL to the code line I mentioned - but it works for me with simple patterns like .[maven-release-plugin].
Thanks for reporting the problem. You can work around the issue without any code change by using
That doesn't fix the bug, but it lets you work without waiting for a fix in the plugin