- Ensure the Lucene ticket index is updated on repository deletion.
changes:
- Specify the --dailyLogFile option for the Ubuntu and CentOS service scripts (issue-348)
+ - The ticket close-on-push commit message regular expression is now configurable by a setting (issue-404)
- Option to allow LDAP users to directly authenticate without performing LDAP searches (pr-162)
- Replace JCommander with args4j to be consistent with other tools (ticket-28)
additions:
- Jeremie Brebec
settings:
- { name: 'realm.ldap.bindpattern', defaultValue: ' ' }
+ - { name: 'tickets.closeOnPushCommitMessageRegex', defaultValue: '(?:fixes|closes)[\\s-]+#?(\\d+)' }
}
#
# SINCE 1.4.0\r
tickets.requireApproval = false\r
\r
+# The case-insensitive regular expression used to identify and close tickets on\r
+# push to the integration branch for commits that are NOT already referenced as\r
+# a patchset tip.\r
+#\r
+# SINCE 1.5.0\r
+tickets.closeOnPushCommitMessageRegex = (?:fixes|closes)[\\s-]+#?(\\d+)\r
+\r
# Specify the location of the Lucene Ticket index\r
#\r
# SINCE 1.4.0\r
\r
if (parseMessage) {\r
// parse commit message looking for fixes/closes #n\r
- Pattern p = Pattern.compile("(?:fixes|closes)[\\s-]+#?(\\d+)", Pattern.CASE_INSENSITIVE);\r
- Matcher m = p.matcher(commit.getFullMessage());\r
- while (m.find()) {\r
- String val = m.group(1);\r
- return Long.parseLong(val);\r
+ String dx = "(?:fixes|closes)[\\s-]+#?(\\d+)";\r
+ String x = settings.getString(Keys.tickets.closeOnPushCommitMessageRegex, dx);\r
+ if (StringUtils.isEmpty(x)) {\r
+ x = dx;\r
+ }\r
+ try {\r
+ Pattern p = Pattern.compile(x, Pattern.CASE_INSENSITIVE);\r
+ Matcher m = p.matcher(commit.getFullMessage());\r
+ while (m.find()) {\r
+ String val = m.group(1);\r
+ return Long.parseLong(val);\r
+ }\r
+ } catch (Exception e) {\r
+ LOGGER.error(String.format("Failed to parse \"%s\" in commit %s", x, commit.getName()), e);\r
}\r
}\r
return 0L;\r