Separate handling of ChangeIds and Git SHAs in Gerrit
Since Ia337ddfe2ddc82c858072135a613786070f0dc67, ChangeIds not
surrounded by whitespace (such as that one) are no longer turned into
links. (It also reduces the minimum length of a hex string required to
recognise a ChangeId from 8 to 7 for reasons that are undocumented, and
therefore suspect.)
The purpose of that patch was to prevent overzealous matching of strings
in e.g. URLs as possible ChangeIds. This stems from
I5cd74bef5510c8dbf3891dcfa3086a141e445f0d, which extended the changeid
regex to also look for Git SHA hashes, which are far more likely to
show up as false positives.
In fact, Ia337ddfe2ddc82c858072135a613786070f0dc67 actually destroys the
original rationale of I5cd74bef5510c8dbf3891dcfa3086a141e445f0d by
refusing to match SHAs that are followed by a closing parenthesis, as
cherry-picked commits on stable branches are.
This patch makes the following changes:
* Separates the changeid and gitsha commentlink handlers
* Restores the changeid patterns to their original values
* Matches only full Git SHAs (not just all 8+ character hex strings)
* Allows for other common punctuation around Git SHAs (commas, colons,
semicolons, parentheses).
Reviewed: https:/ /review. openstack. org/64738 /git.openstack. org/cgit/ openstack- infra/config/ commit/ ?id=eeb9e111fd0 5fbf3042d296eef 074d07eb34a362
Committed: https:/
Submitter: Jenkins
Branch: master
commit eeb9e111fd05fbf 3042d296eef074d 07eb34a362
Author: Zane Bitter <email address hidden>
Date: Thu Jan 2 16:32:37 2014 -0500
Separate handling of ChangeIds and Git SHAs in Gerrit
Since Ia337ddfe2ddc82 c858072135a6137 86070f0dc67, ChangeIds not
surrounded by whitespace (such as that one) are no longer turned into
links. (It also reduces the minimum length of a hex string required to
recognise a ChangeId from 8 to 7 for reasons that are undocumented, and
therefore suspect.)
The purpose of that patch was to prevent overzealous matching of strings 10c8dbf3891dcfa 3086a141e445f0d , which extended the changeid
in e.g. URLs as possible ChangeIds. This stems from
I5cd74bef55
regex to also look for Git SHA hashes, which are far more likely to
show up as false positives.
In fact, Ia337ddfe2ddc82 c858072135a6137 86070f0dc67 actually destroys the dbf3891dcfa3086 a141e445f0d by
original rationale of I5cd74bef5510c8
refusing to match SHAs that are followed by a closing parenthesis, as
cherry-picked commits on stable branches are.
This patch makes the following changes:
* Separates the changeid and gitsha commentlink handlers
* Restores the changeid patterns to their original values
* Matches only full Git SHAs (not just all 8+ character hex strings)
* Allows for other common punctuation around Git SHAs (commas, colons,
semicolons, parentheses).
Fixes bug 1265646
Change-Id: I0844ee2fd8d869 9059eb7afa92b28 2cf5b890c18