Template:Fgdata-old url

From FlightGear wiki
Jump to navigation Jump to search


The following template description is not displayed when the template is inserted in an article.


This template is for creating direct URLs for the archived fgdata-old git version control repository. This is equivalent to the {{fgdata-old source}} template with the full parameter set to 1. It is a subtemplate of the master {{repo link}} template designed to be specific for the archived Gitorious repository.


{{fgdata-old url
| cmd        =
| opt        =
| type       =
| branch     =
| commit     =
| path       =
| line       =
| post       =
| view       =

All parameters are optional.

Parameter Description Abbreviated
cmd An optional command line tool name + options to prepend to the URL. For example git clone. optional
opt Any additional options to show after cmd, but before the URL.
Note The separation of cmd and opt is for future non-CLI handling of a standardised set of cmd parameter values
type Choose between the web interface or a direct repository link. This can be one of git, git web. The default is git web. optional
branch The branch name. This defaults to next. b optional
commit The commit identifier (git hash). This defaults to HEAD. c optional
path The file or directory path. f 1 optional
line The line number(s) of the file to display.
  • For the Gitorious archive: Use a single line number.
l optional
post Text to append. This is forms a set with the parameter cmd and opt. For example it can represent any command line options that come after the URL. optional
view View to display:
  • For the Gitorious archive use one of summary, shortlog, log, blob, commit, commitdiff, patch, tree, history, or raw. The default is commit if a merge request is supplied, blob if a path is given, commit if a commit is given, shortlog if a branch is given, or summary otherwise.
v optional


In this section, the following notation will be used:

Angular brackets + lower case text <xyz>
Template parameters.
Angular brackets + upper case text <XYZ>
Template constructed text.
Square brackets [xyz]
Optional text, only added if the parameter is set.
Or symbol |
The value on the left, if present, otherwise the value on the right of the symbol.


The general design is:

<cmd> <opt> [<URL> <TEXT>] <post>

Here the square brackets do not denote optional text, but will instead produce a Mediawiki link. This can be modified by setting full = 1 to produce:

<cmd> <opt> <URL> <post>

Site: Gitorious

The Gitorious URLs are predominantly query rather than path based. And only the https:// protocol is supported. The base URL constructed by this template is:


Gitorious <URL> for 'type=git'

For this parameter value, the complete <URL> value will be:


Gitorious <URL> for 'type=git web'

As the current archival system is based on queries — the text after the ? character — absolutely any random path after the gitorious.org/ domain name can be used. But, for aesthetics, the project and repository name will be appended by this template. The <URL> will be:


The <QUERY> string consists of parts for the project and repository (p=), the type of view (a=), the path (f=), and the commit, branch or tag (h= or hb=, depending on the view). The <URL> fragment for the project and repository is constructed as:


The <URL> fragment for the view is constructed as:


Where <VIEW> is the value of the view parameter, if supplied, with the value of raw translated to blob_plain. If not supplied, the value of blob is used if path is given, commit if commit is given, or summary otherwise. The <URL> fragment for the path is constructed as:


If the view parameter is set to one of blob, raw, or tree, the <URL> fragment for the commit, branch or tag is constructed as:


Otherwise it will be:


In summary, the full web URL will be:


Gitorious URL <TEXT>

The link text <TEXT>, if the full parameter is not set, will be:


If the simplepath parameter is set, this changes to:


If the pre parameter is supplied, this changes to:


The text parameter trumps all, and <TEXT> is simply:


Plain text

To create a URL or link as plain text and avoid external links, simply use the {{#tag:tagname|content}} magic word construct:

  {{repo link
  | full = 1


To use the <code> tags:

  {{repo link
  | full = 1



No parameters

{{fgdata-old url}}



{{fgdata-old url
| path = Aircraft-uiuc/Cessna172/aircraft.dat


File and a branch

{{fgdata-old url
| path   = Aircraft-uiuc/Cessna172/aircraft.dat
| branch = release/3.2.0


File and a commit

{{fgdata-old url
| path   = Translations/fr/options.xml
| commit = 3d155f


{{fgdata-old url
| path   = Translations/fr/options.xml
| commit = 3d155fb6813c578d1f3c52eb23c98d145b2111ef



{{fgdata-old url
| commit = 9f6576
| view   = commit


File and line number

{{fgdata-old url
| path = AI/nimitz_demo.xml
| line = 4


File, line number, and commit

{{fgdata-old url
| path   = AI/nimitz_demo.xml
| commit = c3fbdf452745effa5a879efe1a958084b60d22e2
| line   = 18



{{fgdata-old url
  | cmd      = git pull
  | protocol = git
  | type     = git
  | post     = master
| lang = "sh"
git pull https://gitorious.org/fg/fgdata.git master

Aliased parameters

This is for https://gitorious.org/fg/fgdata?p=fg:fgdata.git;a=blob;f=Aircraft-uiuc/Cessna172/aircraft.dat;hb=refs/heads/release/3.2.0.

{{fgdata-old url
| f = Aircraft-uiuc/Cessna172/aircraft.dat
| b = release/3.2.0


Numbered parameters

This is for https://gitorious.org/fg/fgdata?p=fg:fgdata.git;a=blob;f=Aircraft-uiuc/Cessna172/aircraft.dat;hb=refs/heads/release/3.2.0.

{{fgdata-old url | Aircraft-uiuc/Cessna172/aircraft.dat | b = release/3.2.0 }}.


Related templates