Template:Gitweb/doc
Appearance
See also: Template:Gerrit and Template:Git repo
This generates a link to a file on Gerrit.
The goal is to avoid manual URLs like
https://gerrit.wikimedia.org/g/mediawiki/extensions/examples/+/HEAD/extension.json
and also future-proof against changes and evolution to source code viewers.
Usage
{{Gitweb |project=mediawiki/extensions/examples |file=extension.json }}
produces
{{Gitweb |project=mediawiki/extensions/examples |file=extension.json| text=important file }}
produces
{{Gitweb |project=operations/mediawiki-config}}
produces
Parameters
- project
- mandatory. Full name of the Git repository, including any "mediawiki/extensions/" or "operations/" prefix, but without
.git
suffix. - file
- optional. Link to a file within the project, instead of linking to the repository summary page.
- text
- optional. Link label text. If not specified, defaults to file name or project name.
- action
- ignored. (Existed in the past for use with Gitweb, but we now use Gitiles.)
- branch
- optional. The branch in the git repo, default 'master' (unless project=operations/puppet, in which case, default 'production')
TemplateData
Adds link to repo/file
Parameter | Description | Type | Status | |
---|---|---|---|---|
Project | project | Project (repo) name
| String | required |
File | file | File name within repo
| String | optional |
Link text | text | no description | String | optional |
Git branch (default 'master') | branch | no description | String | optional |