Hi Yogesh,
On Thu, May 28, 2015 at 06:13:12AM -0700, Yogesh Bhat wrote:
> I guess my below query is in-lined with this discussion.
>
> jira id enforcement in git commit message is configurable via
> "commentLink". I have got a scenario where it has to be "mandatory" for few
> git projects and for others it has to be suggested.
>
> is this doable?
Not in a nice, easy and smooth way.
Before 2.11, it's not possible with pre-built artifacts. You'd have
backport patches yourself.
From 2.11 onwards, it's possible to load its-jira twice under
different names. E.g.: Once as
* its-jira-mandatory, and once as
* its-jira-suggested.
Then the “Plugins / Installed” should show two plugins. Once,
“its-jira-mandatory”, and once “its-jira-suggested”.
Then you'd have to configure gerrit with
[commentLink "its-jira-mandatory"]
[commentLink "its-jira-suggested"]
association = SUGGESTED
in your gerrit.config (and also configure the jira url, user, ... in
the corresponding config sections).
This allows you to enable/disable the mandatory respectively suggested
its-jira variant on a per project basis.
So you can select per project which binding to jira you want.
The crux is that both commentlinks share the same “match”. So the
([A-Z]+-[0-9]+) is getting twice decorated as link. To work around
this, you have to make the two matches distinct, which is just an
exercise in regular expressions.
Have fun,
Christian
P.S.: Or you could implement commentlink inheritance in its-base and
upload the patch to gerrit-review ;-)
--
---- quelltextlich e.U. ---- \\ ---- Christian Aistleitner ----
Companies' registry: 360296y in Linz
Christian Aistleitner
Kefermarkterstrasze 6a/3 Email:
chri...@quelltextlich.at
4293 Gutau, Austria Phone: +43 7946 / 20 5 81
Fax: +43 7946 / 20 5 81
Homepage:
http://quelltextlich.at/
---------------------------------------------------------------