Linkify commit messages using regexp-based rules

This commit adds a new config option to gitiles.
Similar to Gerrit commentlinks[1], there may be one or more config
sections "commentlink", which will have a 'match' and link name.
If the regular expression as specified in 'match' matches, the part of
the text will be linkified with the 'link' value, which may contain
references to the groups of the matching regular expression.

Until now there was just one regular expression covering both standard
web links as well gerrit ChangeId links. We cannot put the configurable
comment links into that regex as well, because there you can have
references to groups within the regular expression and resolving the
references within one large regular expression would get quite messy.

Therefore this commit introduces a new class CommentLinkInfo,
which will do the actual replacing for one configurable or
the web links or the change ids.

Note: this commit does not bring gerrits 'html' option. This only brings
in 'match' and 'link'.

[1] http://gerrit-documentation.googlecode.com/svn/Documentation/2.5.1/config-gerrit.html#_a_id_commentlink_a_section_commentlink

Change-Id: Ic4d75aa55d648fc492559ff13b1dbebf2a1ff4b5
Signed-off-by: Stefan Beller <sbeller@google.com>
4 files changed