Skip to content

Commit 99ec913

Browse files
committed
Bug 982788: Linkify the output of "git push" in bug comments
1 parent aa34323 commit 99ec913

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

extensions/BMO/Extension.pm

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,20 @@ sub bug_format_comment {
480480
}
481481
});
482482

483+
# link git.mozilla.org commit messages
484+
push (@$regexes, {
485+
match => qr#^(To\sssh://[^\@]+\@git\.mozilla\.org\/(.+?.git)\n
486+
\s+)([0-9a-z]+\.\.([0-9a-z]+)\s+\S+\s->\s\S+)#mx,
487+
replace => sub {
488+
my $args = shift;
489+
my $preamble = html_quote($args->{matches}->[0]);
490+
my $repo = html_quote($args->{matches}->[1]);
491+
my $text = $args->{matches}->[2];
492+
my $revision = $args->{matches}->[3];
493+
return qq#$preamble<a href="http://git.mozilla.org/?p=$repo;a=commit;h=$revision">$text</a>#;
494+
}
495+
});
496+
483497
# link to hg.m.o
484498
# Note: for grouping in this regexp, always use non-capturing parentheses.
485499
my $hgrepos = join('|', qw!(?:releases/)?comm-[\w.]+

0 commit comments

Comments
 (0)