summaryrefslogtreecommitdiffstats
path: root/extensions/BMO
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2014-03-13 08:16:44 +0100
committerByron Jones <glob@mozilla.com>2014-03-13 08:16:44 +0100
commit99ec9132eeaee4d62e5495d5eeb020cbade6e02a (patch)
tree00482d56e86d25c19e39c09d8fa3092a005b3ab9 /extensions/BMO
parentaa343237cab0cb076948b36f9d5ec35d24e85070 (diff)
downloadbugzilla-99ec9132eeaee4d62e5495d5eeb020cbade6e02a.tar.gz
bugzilla-99ec9132eeaee4d62e5495d5eeb020cbade6e02a.tar.xz
Bug 982788: Linkify the output of "git push" in bug comments
Diffstat (limited to 'extensions/BMO')
-rw-r--r--extensions/BMO/Extension.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm
index 8d16e2e92..7e5dac5ef 100644
--- a/extensions/BMO/Extension.pm
+++ b/extensions/BMO/Extension.pm
@@ -480,6 +480,20 @@ sub bug_format_comment {
}
});
+ # link git.mozilla.org commit messages
+ push (@$regexes, {
+ match => qr#^(To\sssh://[^\@]+\@git\.mozilla\.org\/(.+?.git)\n
+ \s+)([0-9a-z]+\.\.([0-9a-z]+)\s+\S+\s->\s\S+)#mx,
+ replace => sub {
+ my $args = shift;
+ my $preamble = html_quote($args->{matches}->[0]);
+ my $repo = html_quote($args->{matches}->[1]);
+ my $text = $args->{matches}->[2];
+ my $revision = $args->{matches}->[3];
+ return qq#$preamble<a href="http://git.mozilla.org/?p=$repo;a=commit;h=$revision">$text</a>#;
+ }
+ });
+
# link to hg.m.o
# Note: for grouping in this regexp, always use non-capturing parentheses.
my $hgrepos = join('|', qw!(?:releases/)?comm-[\w.]+