Overview
Commit message transformers can be used to alter how SCM commit messages appear when displayed in the pulse™ web interface. Commit messages are shown in various parts of the interface, where source code changes between builds are shown. The most common use for a commit message transformer is to create links out of certain key phrases. For example, the key phrase "bug 123" could be transformed into a link to a web-based bug tracker. Commit message transformers can more generally be used to make arbitrary changes to messages, such as stripping unwanted details and/or highlighting important information.
Sharing Transformers
Usually the same commit message transformer will apply to many, possibly all, of the projects on your pulse™ server. For this reason it is often useful to configure the transformers in a project template, perhaps even the "global project template", so that it applies to many concrete projects.
Transformer Types
Built-in Transformers
Some high-level transformer types, which are the simplest to configure, are available:
- Jira transformers may be used for linking to Jira issues.
- Link transformers may be used to link arbitrary text to a related URL.
Custom Transformers
You can also apply arbitrary transformations using a custom transformer. To configure a custom transformer, you specify a regular expression to match the key phrase of interest, and a replacement to substitute for the key phrase. The regular expression is in Java format (similar to Perl format). The replacement may make use of group references to include parts or all of the matched key phrase, for example $0 can be used to refer to the entire matched phrase.
Note that the replacement will be displayed literally in the pulse™ web interface. This allows you to use HTML tags in the replacement. It also means that you must take care to escape HTML special characters in the replacement if you want them to appear literally. For example, you should use < and > for < and > respectively.
Examples
Remove all text up to the first colon
Use the regular expression:
and an empty replacement string.
Turn all occurences of the word "error" red
Use the expression:
and the replacement: