Last updated February 05, 2009 07:08, by hgsonic

Example Use-Case

Lets say developers put bug ids in their commit messages. Wouldnt it be useful to have the bug ids show up as links to the bug page for that bug id on the web UI? For example look at the descriptions of the commit messages on the following page:

You can see the 7 digit numbers are links to a make-believe bug webpage. The regex filter allows you to specify the in HGRC file what regex expression to look for in the commit descriptions, and what to replace it with. In the example below, I am looking for all 7 digit numbers (and only 7 digits, the regex will not match 8 digit numbers) and replacing it with a URL, which includes the 7 digit number. Note that I am using a style for the link called "pla" - feel free to use that style.

Configure HGRC to Use Regex Filter

In order to use regex filter over the web interface, you must use the gitweb_sonic template. First create a folder called sonichgv2m102 in the htdocs folder (assuming you have apache running). Copy over the files in the sonichgv2m102/static folder to this newly created directory. Then modify the HGRC file of the repo to include:

 filterval=<a class=pla href=>REGEXFILTER</a>

Regex Filter in Action

Go to the following shortlog page:

You will see the bug ids (7 digit numbers) are links to a make-believe bug webpage.

  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2014, Oracle Corporation and/or its affiliates
(revision 20160325.c4a3dc8)
Please Confirm