Open main menu

Changes

Template:Repo link/doc design gitorious

3,260 bytes added, 18:12, 8 March 2016
Documentation of the merge request URL construction.
<h3>Site: Gitorious</h3>
The Gitorious URLs are predominantly query rather than path based. And only the <code>https://</code> protocol is supported. The base URL constructed by this template is:
<nowiki><protocol>://gitorious.org/<proj>/<repo></nowiki>

==== Gitorious <URL> for 'type=git' ====
For this parameter value, the complete <code><URL></code> value will be:
<nowiki><protocol>://gitorious.org/<proj>/<repo>.git</nowiki>

==== Gitorious <URL> for 'type=git web' ====
As the current archival system is based on queries &mdash; the text after the <code>?</code> character &mdash; absolutely any random path after the <code>gitorious.org/</code> domain name can be used. But, for aesthetics, the project and repository name will be appended by this template. The <code><URL></code> will be:
<nowiki><protocol>://gitorious.org/<proj>/<repo>?<QUERY>[#l<line>]</nowiki>

The <code><QUERY></code> string consists of parts for the project and repository (<code>p=</code>), the type of view (<code>a=</code>), the path (<code>f=</code>), and the commit, branch or tag (<code>h=</code> or <code>hb=</code>, depending on the view).
The <code><URL></code> fragment for the project and repository is constructed as:
<nowiki><protocol>://gitorious.org/<proj>/<repo>?p=<proj>:<repo>.git</nowiki>

The <code><URL></code> fragment for the view is constructed as:
<nowiki><protocol>://gitorious.org/<proj>/<repo>?a=<VIEW></nowiki>

Where <code><VIEW></code> is the value of the '''view''' parameter, if supplied, with the value of '''raw''' translated to <code>blob_plain</code>. If not supplied, the value of <code>blob</code> is used if '''path''' is given, <code>commit</code> if '''commit''' is given, or <code>summary</code> otherwise.
The <code><URL></code> fragment for the path is constructed as:
<nowiki><protocol>://gitorious.org/<proj>/<repo>?f=<path></nowiki>

If the '''view''' parameter is set to one of '''blob''', '''raw''', or '''tree''', the <code><URL></code> fragment for the commit, branch or tag is constructed as:
<nowiki><protocol>://gitorious.org/<proj>/<repo>[?hb=refs/merge-requests/<mr>|<commit>|refs/heads/<branch>]</nowiki>

Otherwise it will be:
<nowiki><protocol>://gitorious.org/<proj>/<repo>[?h=refs/merge-requests/<mr>|<commit>|refs/heads/<branch>]</nowiki>

In summary, the full web URL will be:
<nowiki><protocol>://gitorious.org/<proj>/<repo>?p=<proj>:<repo>.git;a=<VIEW>[;f=<path>][;<h|hb>=refs/merge-requests/<mr>|<commit>|refs/heads/<branch>][#l<line>]</nowiki>

==== Gitorious URL <TEXT> ====
The link text <code><TEXT></code>, if the '''full''' parameter is not set, will be:
<nowiki><proj>/<repo>/<commit|branch|HEAD>[/<path>][#l<line>]</nowiki>

If the '''simplepath''' parameter is set, this changes to:
<nowiki>[/<path>][#l<line>]</nowiki>

If the '''pre''' parameter is supplied, this changes to:
<nowiki><pre>[/<path>][#l<line>]</nowiki>

The '''text''' parameter trumps all, and <code><TEXT></code> is simply:
<pre><nowiki><text></nowiki></pre>
<noinclude>

{{Informative template|1=
== Goal ==

To provide documentation of the design of the {{tl|repo link}} family of templates. This is only for use within documentation of the subtemplates.

}}

[[Category:Repository link templates]]
</noinclude>
Trusted, Bureaucrats
4,223

edits