Ryan Lane has submitted this change and it was merged.

Change subject: (bug 45163) make gerrit's link parser not match incomplete words
......................................................................


(bug 45163) make gerrit's link parser not match incomplete words

It would be better to use something more sophisticated than \b to not
match within already existing links (like it was done for Bugzilla's
parser: Ib79728e9), but gerrit is using a DFA regex library which by
definition doesn't support any advanced regex features.

Change-Id: I93d1a978c366dfdf19a04994ba4df4ef16d6dc06
---
M templates/gerrit/gerrit.config.erb
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Ryan Lane: Looks good to me, approved
  Demon: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/templates/gerrit/gerrit.config.erb 
b/templates/gerrit/gerrit.config.erb
index 8181ca3..91c2bf6 100644
--- a/templates/gerrit/gerrit.config.erb
+++ b/templates/gerrit/gerrit.config.erb
@@ -53,7 +53,7 @@
 [user]
        email = [email protected]
 [commentlink "changeid"]
-       match = (I[0-9a-f]{8,40})
+       match = \\b(I[0-9a-f]{8,40})\\b
        link = "#q,$1,n,z"
 [commentlink "commit"]
        match = \\b([0-9a-f]{8,40})\\b
@@ -62,10 +62,10 @@
        match = "\\b([bB][uU][gG]\\:?\\s+#?)(\\d+)\\b"
        link = https://bugzilla.wikimedia.org/$2
 [commentlink "codereview"]
-       match = r(\\d+)
+       match = \\br(\\d+)\\b
        link = https://www.mediawiki.org/wiki/Special:CodeReview/MediaWiki/$1
 [commentlink "rt"]
-       match = "\\b[rR][tT]\\s+#?(\\d+)"
+       match = "\\b[rR][tT]\\s+#?(\\d+)\\b"
        link = https://rt.wikimedia.org/Ticket/Display.html?id=$1
 [mimetype "application/javascript"]
        safe = true

-- 
To view, visit https://gerrit.wikimedia.org/r/50029
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I93d1a978c366dfdf19a04994ba4df4ef16d6dc06
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Matmarex <[email protected]>
Gerrit-Reviewer: Demon <[email protected]>
Gerrit-Reviewer: Ryan Lane <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to