Issue 454: commentlink.match doesn't seem to work with '#'
Status:  Released
Owner: ----
Closed:  Mar 2012
Reported by docw...@gmail.com, Feb 18, 2010
Affected Version: 2.1.1

What steps will reproduce the problem?
1. Create a commentlink section, setting match to: (bug:?\\s+#?)(\\d+)
2. Restart gerrit.  Notice that it doesn't seem to like restarting. It takes me 
several tries to get it restarted; it says it is restarted, but the URLs don't 
load.
3. Try viewing any changes.

What is the expected output? What do you see instead?
Nothing happens.  The URL changes, but the change doesn't load.

Please provide any additional information below.
I suspect this is something do with config-file vs. regex.  Removing the '#?' 
part fixes this.  I tried '\#?' but that produces weird errors.

Feb 18, 2010
#1 docw...@gmail.com
The restart gerrit is a red-herring.  It's due to my reverse proxy caching a "couldn't 
connect to host".  I'll have to lookup how to change that in apache.
Feb 18, 2010
#2 sop@google.com
You need to put the value in "".  See the documentation, I thought I had a description of 
that, the configuration file parser stops on # and reads that as a comment, which you 
can escape by putting it in double quotes.
Status: Invalid
Feb 18, 2010
#3 docw...@gmail.com
May I suggest that you update the example to reflect that, then?

On: http://gerrit.googlecode.com/svn/documentation/2.1/config-gerrit.html

Change the bugzilla example to the following. The common bugzilla format is usually 
" bug #123 ":
[commentlink "bugzilla"]
  match = "(bug\\s+#?)(\\d+)"
  link = http://bugs.example.com/show_bug.cgi?id=$2

Is there a way to do case insensitivity? 
Feb 21, 2010
#4 sop@google.com
Change I69429da510d62c93b6dd5b24dad36e111c4e7bc5 updates
the documentation to use the example you supplied.

To do case insensitivity you have to use the really awkward form of
"[bB][uU][gG]".  The APIs we are using to perform the replacements
doesn't support regex flags, so we can't request case insensitivity
from the pattern matcher.  There also isn't a standard command in
JavaScript like "(?i)" within the expression.
Status: Fixed
Labels: FixedIn-2.1.2
Mar 27, 2012
#5 sop@google.com
(No comment was entered for this change.)
Status: Released