Changes

Make file_regexp a suggested parameter
[https://gerrit.wikimedia.org/r/#/q/owner:%22{{urlencode:{{{1}}}}}%22 {{{1}}}] {{#if:{{{file_regexp|}}}|(only commits where {{#ifeq:{{{2|}}}|match_all_files|all|at least one}} of the {{#ifeq:{{{3|}}}|only_match_new_files|new|changed}} files match {{green|/<code>{{{file_regexp}}}</code>/}})}}<noinclude>

Examples:
* <code>{{{{PAGENAME}}<nowiki>|Gerrit username}}</nowiki></code> → {{ {{PAGENAME}}|Gerrit username}}
* <code>{{{{PAGENAME}}<nowiki>|Gerrit username|file_regexp=<nowiki>\.(txt|php)$&lt;/nowiki>}}</nowiki></code> → {{ {{PAGENAME}}|Gerrit username|file_regexp=<nowiki>\.(txt|php)$</nowiki>}}
*:{{Note}} Don't forget to use &lt;nowiki> tags for the <code>file_regexp</code> parameter, if you want to have template-specific characters in the regexp, such as <code>|</code>
* <code>{{{{PAGENAME}}<nowiki>|Gerrit username|file_regexp=<nowiki>^includes/.+\.php$&lt;/nowiki>|match_all_files}}</nowiki></code> → {{ {{PAGENAME}}|Gerrit username|file_regexp=<nowiki>^includes/.+\.php$</nowiki>|match_all_files}}
* <code>{{{{PAGENAME}}<nowiki>|Gerrit username|file_regexp=<nowiki>^includes/.+\.php$&lt;/nowiki>||only_match_new_files}}</nowiki></code> → {{ {{PAGENAME}}|Gerrit username|file_regexp=<nowiki>^includes/.+\.php$</nowiki>||only_match_new_files}} <templatedata>
{
"params": {
"1": {
"label": "Gerrit username",
"description": "Your username on gerrit.wikimedia.org",
"type": "string",
"required": true
},
"2": {
"description": "If you set this to match_all_files, the file regexp must match all changed files in the commit, not just one of them",
"type": "string"
},
"3": {
"description": "Set this to only_match_new_files to make the file regexp only look at new files created by the commit"
},
"file_regexp": {
"label": "File path regexp",
"description": "Only subscribe to commits where at least one of the files matches this regexp. Don't forget to wrap this in <nowiki> tags if you use | or other special characters",
"example": "<nowiki>\\.(txt|php)$</nowiki>",
"type": "string",
"suggested": true
}
},
"description": "Add this template to [[Git/Reviewers]] to be automatically added as a reviewer on Gerrit changes that match certain criteria",
"format": "inline"
}
</templatedata>
</noinclude>