Template:Repo link

From FlightGear wiki
Revision as of 21:48, 1 March 2016 by Bugman (talk | contribs) (Use internal links for SourceForge, GitHub, GitLab, and Gitorious. A master template should avoid external links.)
Jump to navigation Jump to search

flightgear/flightgear/next


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

Goal

This is designed to be a master template for creating links or URLs for all types of version control repository. It can be used directly for full flexibility, or via one of the specific subtemplates listed in #Related templates.

Note This template may add an external link. You will therefore have to answer an anti-spam security question before your edit is saved.

Usage

{{repo link
| site       = 
| cmd        = 
| opt        = 
| protocol   = 
| login      = 
| type       = 
| user       = 
| proj       = 
| repo       = 
| branch     = 
| tag        = 
| path       = 
| commit     = 
| line       = 
| post       = 

| view       = 
| text       = 
| pre        = 
| simplepath = 
| full       = 
}}

All parameters except site are optional.

site
Points the template to a repository host:
  • For SourceForge use either s, sf or sourceforge.
  • For GitHub use either gh, gith or github.
  • For GitLab use either gl, gitl or gitlab.
  • For the Gitorious archive use either g, gito or gitorious.
  • For generic repositories, the site parameter will be interpreted as the domain name.
cmd
An optional command line tool name + options to prepend to the URL. For example git clone.
opt
Any additional options to show after cmd, if supplied.
Note Developer note: This is for future non-CLI handling of a standardised set of cmd parameter values
protocol
The URL protocol, for example https, http, git, ssh, svn. This defaults to https.
login
The optional user login.
type
Choose between git or svn and web interface, a direct repository link, or a zip file download. This can be one of git, git web, svn, svn web, or zip. The default is git web.
Note Zip archive downloads are currently only supported for GitHub and GitLab repositories.
user
The name of the user page for the open source infrastructure. This is notably different to the login parameter. This will generally have precedence over the proj parameter. The user page is treated in the same way as a project name.
proj
The name of the project, consisting of a grouping of repositories on the open source infrastructure. This defaults to flightgear.
repo
The name of the repository, for example fgdata. A project registered on one of the open source infrastructures generally allows for multiple repositories under that project name. This defaults to flightgear.
branch
The git or svn branch name. As tags are simply branches in SVN repositories, this parameter can also be used for svn tags. For git tags, simply append /~ to the tag name. This defaults to next or trunk for git and svn respectively.
Note Only used for SourceForge repositories.
tag
Reserved for future use. This will be used for a situation in which tags and branches are treated differently by an open source infrastructure site.
path
The file path.
commit
The commit identifier (git hash or svn revision number). This defaults to next and HEAD for git and svn respectively.
Note Only used for SourceForge repositories.
line
The line number(s) of the file to display.
  • For SourceForge and the Gitorious archive: Use a single line number.
  • For GitHub either use:
    • A single line number, for example 2.
    • Two line numbers separated with a hyphen (-), for example 3-10.
post
Text to append. This is forms a set with to the cmd and opt parameters. For example it can represent any command line options that come after the URL.
view
View to display:
  • For SourceForge use one of tree, log, commit, or rss. The default is tree.
  • For GitHub use one of blob, blame, commit, commits or raw. The default is tree.
  • For the Gitorious archive use one of summary, shortlog, log, blob, commit, commitdiff, tree, history, or raw. The default is blob if a path is given, commit if a commit is given, or summary otherwise.
text
Text to display as the link label. Overrides pre.
pre
Prefix to a link label.
simplepath
If set, this strips off the repository name from the URL label, leaving just the contents of the path parameter.
Note The text parameter will override this.
full
If set, the full URL will be shown rather than any text label.

Design

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.

Overview

Independent of the site parameter, 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>

The URL is constructed differently for each of the categories of the site parameter.

Site: SourceForge

Project vs. developer page

For a normal SourceForge project and a SourceForge developer page, the base URL is respectively constructed as:

<protocol>://<DOMAIN>/p/<proj>/<repo>/
<protocol>://<DOMAIN>/u/<user>/<repo>/

This will be abstracted as:

<protocol>://<DOMAIN>/<u|p>/<user|proj>/<repo>/

For the git and svn values of the type parameter, a login is allowed:

<protocol>://[<login>@]<DOMAIN>/<u|p>/<user|proj>/<repo>/

SourceForge <URL> for 'type=git'

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

<protocol>://[<login>@]git.code.sf.net/<u|p>/<user|proj>/<repo>/

SourceForge <URL> for 'type=git web'

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

<protocol>://sourceforge.net/<u|p>/<user|proj>/<repo>/ci/<commit|branch>/<VIEW>/<path>[#l<line>]

The <VIEW> value for different values of view is:

tree
tree/.
log
log/?path=.
commit
nothing.

If the parameter setting view=rss is used, a different <URL> value is produced:

<protocol>://sourceforge.net/<u|p>/<user|proj>/<repo>/feed/

SourceForge <URL> for 'type=svn'

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

<protocol>://[<login>@]svn.code.sf.net/<u|p>/<user|proj>/<repo>/<branch>[/<path>][@<commit>]

SourceForge <URL> for 'type=svn web'

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

<protocol>://sourceforge.net/<u|p>/<user|proj>/<repo>/<commit|HEAD>/<VIEW>/<branch>[/<path>][#l<line>]

The <VIEW> value for different values of view is:

tree
tree/.
log
log/?path=.

If the parameter setting view=commit is used, a truncated <URL> value is produced:

<protocol>://sourceforge.net/<u|p>/<user|proj>/<repo>/<commit|HEAD>/

If the parameter setting view=rss is used, a different <URL> value is produced:

<protocol>://sourceforge.net/<u|p>/<user|proj>/<repo>/feed/

SourceForge URL <TEXT> for 'type=git' and 'type=git web'

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

<user|proj>/<repo>/<commit|branch>[/<path>][#l<line>] <DESC>

If the simplepath parameter is set, this changes to:

[/<path>][#l<line>] <DESC>

If the pre parameter is supplied, this changes to:

<pre>[/<path>][#l<line>] <DESC>

The RSS feed is a special case in that <TEXT> will be one of:

<user|proj>/<repo> <DESC>
<pre> <DESC>

The description <DESC> is dependent on the view parameter:

tree
Nothing.
log
log view.
commit
commit view.
rss
RSS feed.

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

<text>

SourceForge URL <TEXT> for 'type=svn' and 'type=svn web'

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

<user|proj>/<repo>/<branch>[/<path>][#l<line>][@r<commit>] <DESC>

If the simplepath parameter is set, this changes to:

[/<path>][#l<line>][@r<commit>] <DESC>

If the pre parameter is supplied, this changes to:

<pre>[/<path>][#l<line>][@r<commit>] <DESC>

The RSS feed is a special case in that <TEXT> will be one of:

<user|proj>/<repo> <DESC>
<pre> <DESC>

The description <DESC> is dependent on the view parameter:

tree
Nothing.
log
log view.
commit
commit view.
rss
RSS feed.

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

<text>

Site: GitHub

The base URL for GitHub repositories is:

<protocol>://github.com/<user|proj>/<repo>

GitHub <URL> for 'type=git'

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

<protocol>://github.com/<user|proj>/<repo>.git

GitHub <URL> for 'type=git web'

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

<protocol>://github.com/<user|proj>/<repo>/<view>/<commit|branch>[/<path>][#L<line>]

GitHub <URL> for 'type=zip'

For this parameter value, the zip file URL will be:

<protocol>://github.com/<proj>/<repo>/archive/<commit|tag|branch>.zip

If neither a commit, branch, nor tag is specified, the URL will default to:

<protocol>://github.com/<proj>/<repo>/archive/master.zip

GitHub URL <TEXT> for 'type=git' and 'type=git web'

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

github/<user|proj>/<repo>/<commit|branch|HEAD>[/<path>][#L<line>]

If the simplepath parameter is set, this changes to:

[/<path>][#L<line>]

If the pre parameter is supplied, this changes to:

<pre>[/<path>][#L<line>]

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

<text>

GitHub URL <TEXT> for 'type=zip'

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

github/<user|proj>/<repo>/[<commit|tag|branch>] zip file

If the simplepath parameter is set, this changes to:

 zip file

If the pre parameter is supplied, this changes to:

<pre> zip file

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

<text>

Site: GitLab

The base URL for GitLab repositories is:

<protocol>://gitlab.com/<proj>[/<repo>]

GitLab <URL> for 'type=git'

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

<protocol>://gitlab.com/<proj>[/<repo>].git

GitLab <URL> for 'type=git web'

This is not implemented yet. Please add new examples to allow this template to be extended.

GitLab <URL> for 'type=zip'

For this parameter value, the base zip file URL will be:

<protocol>://gitlab.com/<proj>/<repo>/repository/archive.zip

If a branch, tag, or commit is specified, this will be added as a query:

<protocol>://gitlab.com/<proj>/<repo>/repository/archive.zip[?ref=<commit|tag|branch>]

GitLab URL <TEXT>

This is not implemented yet. Please add new examples to allow this template to be extended.

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:

<protocol>://gitorious.org/<proj>/<repo>

Gitorious <URL> for 'type=git'

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

<protocol>://gitorious.org/<proj>/<repo>.git

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:

<protocol>://gitorious.org/<proj>/<repo>?<QUERY>[#l<line>]

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:

<protocol>://gitorious.org/<proj>/<repo>?p=<proj>:<repo>.git

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

<protocol>://gitorious.org/<proj>/<repo>?a=<VIEW>

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:

<protocol>://gitorious.org/<proj>/<repo>?f=<path>

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:

<protocol>://gitorious.org/<proj>/<repo>[?hb=<commit>|refs/heads/<branch>]

Otherwise it will be:

<protocol>://gitorious.org/<proj>/<repo>[?h=<commit>|refs/heads/<branch>]

In summary, the full web URL will be:

<protocol>://gitorious.org/<proj>/<repo>?p=<proj>:<repo>.git;a=<VIEW>[;f=<path>][;<h|hb>=<commit>|refs/heads/<branch>][#l<line>]

Gitorious URL <TEXT>

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

<proj>/<repo>/<commit|branch|HEAD>[/<path>][#l<line>]

If the simplepath parameter is set, this changes to:

[/<path>][#l<line>]

If the pre parameter is supplied, this changes to:

<pre>[/<path>][#l<line>]

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

<text>

Site: Generic

If the site parameter does not match one of the know open source infrastructures, then an attempt will be made to create a generic repository link. The base URL for generic repositories is:

<protocol>://[<login>@]<site>/<user|proj>[/<repo>]

Generic repository <URL> for 'type=git'

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

Generic repository <URL> for 'type=git web'

This is not implemented yet. Please add new examples to allow this template to be extended.

Generic repository <URL> for 'type=svn'

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

<protocol>://[<login>@]<site>/<user|proj>[/<repo>]/<branch>

The value of branch defaults to trunk.

Generic repository <URL> for 'type=svn web'

This is not implemented yet. Please add new examples to allow this template to be extended.

Generic repository URL <TEXT>

This is not implemented yet. Please add new examples to allow this template to be extended.

Plain text

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

{{#tag:nowiki|
  {{repo link
  | full = 1
  }}
}}

https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/

Examples

SourceForge examples

FlightGear repository

The source repository

This is a link to https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/.

{{repo link
| site = sf
| proj = flightgear
| repo = flightgear
| text = The flightgear source repository
}}.

The flightgear source repository.

Git clone

This is for git clone git://git.code.sf.net/p/flightgear/flightgear flightgear-flightgear.

{{#tag:code|{{#tag:nowiki|{{repo link
  | site     = sf
  | cmd      = git clone
  | protocol = git
  | repo     = flightgear
  | type     = git
  | post     = flightgear-flightgear
  | full     = 1
}}}}}}.

git clone git://git.code.sf.net/p/flightgear/flightgear/ flightgear-flightgear.

File with line number

This is a link to https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/src/Main/fg_init.cxx#l1.

{{repo link
| site = sf
| repo = flightgear
| path = src/Main/fg_init.cxx
| line = 1
}}.

flightgear/flightgear/next/src/Main/fg_init.cxx#l1.

File prefixed with $FLIGHTGEAR_SRC

This is a link to https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/src/Main/fg_init.cxx. The expected link text is "$FLIGHTGEAR_SRC/src/Main/fg_init.cxx".

{{repo link
| site = sf
| repo = flightgear
| path = src/Main/fg_init.cxx
| pre  = $FLIGHTGEAR_SRC
}}.

$FLIGHTGEAR_SRC/src/Main/fg_init.cxx.

Branch

This is a link to https://sourceforge.net/p/flightgear/flightgear/ci/sportmodel/tree/.

{{repo link
| site   = sf
| repo   = flightgear
| branch = sportmodel
}}.

flightgear/flightgear/sportmodel.

Tag

This is a link to https://sourceforge.net/p/flightgear/flightgear/ci/version/2016.1.1/~/tree/.

{{repo link
| site   = sf
| repo   = flightgear
| branch = version/2016.1.1/~
}}.

flightgear/flightgear/version/2016.1.1/~.

Tag, history view

This is a link to https://sourceforge.net/p/flightgear/flightgear/ci/version/2016.1.1/~/log/?path=.

{{repo link
| site   = sf
| repo   = flightgear
| branch = version/2016.1.1/~
| view   = log
}}.

flightgear/flightgear/version/2016.1.1/~ log view.

Commit

This is a link to https://sourceforge.net/p/flightgear/flightgear/ci/f88d6418297e250138fda48f5a7d3e51bb3c543d/

{{repo link
| site   = sf
| repo   = flightgear
| commit = f88d6418297e250138fda48f5a7d3e51bb3c543d
| view   = commit
}}.

flightgear/flightgear/f88d6418297e250138fda48f5a7d3e51bb3c543d commit view.

Commit, history view

This is a link to https://sourceforge.net/p/flightgear/flightgear/ci/f88d6418297e250138fda48f5a7d3e51bb3c543d/log/?path=

{{repo link
| site   = sf
| repo   = flightgear
| commit = f88d6418297e250138fda48f5a7d3e51bb3c543d
| view   = log
}}.

flightgear/flightgear/f88d6418297e250138fda48f5a7d3e51bb3c543d log view.

Repository clone

This is for the command git clone git://git.code.sf.net/p/flightgear/flightgear/ flightgear-flightgear

{{#tag:code|{{#tag:nowiki|{{repo link
| site     = sf
| cmd      = git clone
| protocol = git
| type     = git
| repo     = flightgear
| post     = flightgear-flightgear
| full     = 1
}}}}}}.

git clone git://git.code.sf.net/p/flightgear/flightgear/ flightgear-flightgear.

Or as plain text:

{{#tag:nowiki|{{repo link
  | site     = sf
  | cmd      = git clone
  | protocol = git
  | type     = git
  | repo     = flightgear
  | post     = flightgear-flightgear
  | full     = 1
}}}}.

git clone git://git.code.sf.net/p/flightgear/flightgear/ flightgear-flightgear.

SimGear repository

Non-web URL

This is a link to ssh://git.code.sf.net/p/flightgear/simgear.

{{repo link
| site     = sf
| protocol = ssh
| type     = git
| repo     = simgear
| full     = 1
}}.

ssh://git.code.sf.net/p/flightgear/simgear/.

Simgear RSS feed

This is a link to https://sourceforge.net/p/flightgear/simgear/feed.

{{repo link
| site = sf
| repo = simgear
| view = rss
| text = Simgear RSS feed
}}.

Simgear RSS feed.

Or without text:

{{repo link
| site   = sf
| login  = dummy_user                                  <!-- Dummy parameter, not to be used -->
| repo   = simgear
| view   = rss
| branch = branches/release-2016.1                     <!-- Dummy parameter, not to be used -->
| path   = simgear/                                    <!-- Dummy parameter, not to be used -->
| commit = f88d6418297e250138fda48f5a7d3e51bb3c543d    <!-- Dummy parameter, not to be used -->
| line   = 10                                          <!-- Dummy parameter, not to be used -->
}}.

flightgear/simgear RSS feed.

FGAddon repository links

Branch (HEAD)

This is a link for https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/branches/release-3.4.0/Aircraft.

{{repo link
| site   = sf
| type   = svn web
| repo   = fgaddon
| branch = branches/release-3.4.0
| path   = Aircraft
| text   = FG 3.4 add-on aircraft
}}.

FG 3.4 add-on aircraft.

r1001

This is a link for https://sourceforge.net/p/flightgear/fgaddon/1001.

{{repo link
| site   = sf
| type   = svn web
| repo   = fgaddon
| commit = 1001
| view   = commit
}}.

flightgear/fgaddon/trunk@r1001 commit view.

Trunk (r1000)

This is a link for https://sourceforge.net/p/flightgear/fgaddon/1000/tree/trunk/Aircraft.

{{repo link
| site   = sf
| type   = svn web
| repo   = fgaddon
| commit = 1000
| branch = trunk
| path   = Aircraft
}}.

flightgear/fgaddon/trunk/Aircraft@r1000.

Trunk, real path

This is a link for https://svn.code.sf.net/p/flightgear/fgaddon/trunk.

{{repo link
| site   = sf
| type   = svn
| repo   = fgaddon
| branch = trunk
| full   = 1
}}.

https://svn.code.sf.net/p/flightgear/fgaddon/trunk.

Svn checkout

This is for returning svn co https://svn.code.sf.net/p/flightgear/fgaddon/branches/release-3.4.0/Aircraft/V22-Osprey

{{#tag:code|{{#tag:nowiki|{{repo link
| site   = sf
| cmd    = svn co
| type   = svn
| repo   = fgaddon
| branch = branches/release-3.4.0
| path   = Aircraft/V22-Osprey
| full   = 1
}}.

svn co https://svn.code.sf.net/p/flightgear/fgaddon/branches/release-3.4.0/Aircraft/V22-Osprey.

Svn trunk checkout

This is for returning svn co https://svn.code.sf.net/p/flightgear/fgaddon/trunk flightgear-fgaddon

{{#tag:code|{{#tag:nowiki|{{repo link
| site = sf
| cmd  = svn co
| type = svn
| repo = fgaddon
| post = flightgear-fgaddon 
| full = 1
}}.

svn co https://svn.code.sf.net/p/flightgear/fgaddon/trunk flightgear-fgaddon.

Svn checkout (trunk@r1000)

This is for returning svn co https://svn.code.sf.net/p/flightgear/fgaddon/trunk@r1000

{{#tag:code|{{#tag:nowiki|{{repo link
| site   = sf
| cmd    = svn co
| type   = svn
| repo   = fgaddon
| commit = 1000
| full   = 1
}}}}}}.

svn co https://svn.code.sf.net/p/flightgear/fgaddon/trunk@r1000.

File and line number link

This is for https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/trunk/Aircraft/14bis/14bis-set.xml#l12.

{{repo link
| site       = sf
| type       = svn web
| repo       = fgaddon
| path       = Aircraft/14bis/14bis-set.xml
| line       = 12
| branch     = trunk
| simplepath = 1
}}.

Aircraft/14bis/14bis-set.xml#l12.

File prefixed with $FG_AIRCRAFT

This is for https://sourceforge.net/p/flightgear/fgaddon/1234/tree/trunk/Aircraft/X15/X15-set.xml. The expected link text is "$FG_AIRCRAFT/Aircraft/X15/X15-set.xml".

{{repo link
| site = sf
| type = svn web
| repo = fgaddon
| path = Aircraft/X15/X15-set.xml
| pre  = $FG_AIRCRAFT
}}.

$FG_AIRCRAFT/Aircraft/X15/X15-set.xml.

File prefixed with $FG_AIRCRAFT and identified by commit

This is for https://sourceforge.net/p/flightgear/fgaddon/1234/tree/trunk/Aircraft/X15/X15-set.xml. The expected link text is "$FG_AIRCRAFT/Aircraft/X15/X15-set.xml@1234".

{{repo link
| site   = sf
| type   = svn web
| repo   = fgaddon
| path   = Aircraft/X15/X15-set.xml
| commit = 1234
| pre    = $FG_AIRCRAFT
}}.

$FG_AIRCRAFT/Aircraft/X15/X15-set.xml@r1234.

svn import

This should give:

svn import DaSH/ svn+ssh://<username>@svn.code.sf.net/p/flightgear/fgaddon/trunk/Aircraft/ -m "Initial import of the DaSH human powered aircraft.\n\nFor details see the forum thread at http://forum.flightgear.org/viewtopic.php?f=4&t=24495 ."
{{#tag:syntaxhighlight|
{{repo link
  | cmd      = svn import DaSH/
  | repo     = fgaddon
  | protocol = svn+ssh
  | login    = <username>
  | type     = svn
  | path     = Aircraft/
  | post     = -m "Initial import of the DaSH human powered aircraft.\n\nFor details see the forum thread at http://forum.flightgear.org/viewtopic.php?f=4&t=24495 ."
  | full     = 1
}}
| lang = "sh"
}}
svn import DaSH/ svn+ssh://<username>@svn.code.sf.net/p/flightgear/fgaddon/trunk/Aircraft/ -m "Initial import of the DaSH human powered aircraft.\n\nFor details see the forum thread at http://forum.flightgear.org/viewtopic.php?f=4&t=24495 ."
FGAddon RSS feed

This is a link to https://sourceforge.net/p/flightgear/fgaddon/feed.

{{repo link
| site   = sf
| login  = dummy_user                  <!-- Dummy parameter, not to be used -->
| repo   = fgaddon
| type   = svn web
| view   = rss
| branch = branches/release-2016.1     <!-- Dummy parameter, not to be used -->
| path   = Aircraft/                   <!-- Dummy parameter, not to be used -->
| commit = 1234                        <!-- Dummy parameter, not to be used -->
| line   = 200                         <!-- Dummy parameter, not to be used -->
}}.

flightgear/fgaddon RSS feed.

User fork of the FlightGear repository

This is for https://sourceforge.net/u/edauvergne/code-py-ogel/ci/python/tree/test.py#l23.

{{repo link
| site   = sf
| repo   = code-py-ogel
| branch = python
| path   = test.py
| line   = 23
| user   = edauvergne
}}.

edauvergne/code-py-ogel/python/test.py#l23.

GitHub examples

User repository

{{repo link
| site = gh
| user = hamzaalloush
| repo = fgradar-clone
}}.

github/hamzaalloush/fgradar-clone/master.

User repository prefixed with $FG_ROOT

{{repo link
| site  = gith
| user  = bhugh
| repo  = Bombable
| line  = 30
| path  = Aircraft/A-10-Bombable/A-10-Bombable-set.xml
| pre   = $FG_ROOT
}}.

$FG_ROOT/Aircraft/A-10-Bombable/A-10-Bombable-set.xml#L30.

The c172p-detailed repository

This is for the c172p-detailed repository https://github.com/Juanvvc/c172p-detailed/tree/master (this is the same as https://github.com/Juanvvc/c172p-detailed).

{{repo link
| site = gh
| user = Juanvvc
| repo = c172p-detailed
| text = A high detailed version of the C172P aircraft for FlightGear
}}

A high detailed version of the C172P aircraft for FlightGear.

Git clone

This is for cloning the c172p-detailed aircraft with git clone https://github.com/Juanvvc/c172p-detailed.git.

{{#tag:code | {{#tag:nowiki |
  {{repo link
  | site = gh
  | cmd  = git clone
  | user = Juanvvc
  | repo = c172p-detailed
  | type = git
  | full = 1
  }}
}} }}

git clone https://github.com/Juanvvc/c172p-detailed.git

File with line number

This is for https://github.com/Juanvvc/c172p-detailed/blob/release/2016.1/c172p-set.xml#L49.

{{repo link
| site   = gh
| user   = Juanvvc
| repo   = c172p-detailed
| view   = blob
| branch = release/2016.1
| path   = c172p-set.xml
| line   = 49
| text   = The c172p-detailed authors
}}.

The c172p-detailed authors.

Raw view

This is for https://github.com/Juanvvc/c172p-detailed/raw/master/c172p-set.xml, which will redirect itself to https://raw.githubusercontent.com/Juanvvc/c172p-detailed/master/c172p-set.xml.

{{repo link
| site = gh
| user = Juanvvc
| repo = c172p-detailed
| view = raw
| path = c172p-set.xml
| full = 1
}}.

https://github.com/Juanvvc/c172p-detailed/raw/master/c172p-set.xml.

Commit

This is for https://github.com/Juanvvc/c172p-detailed/commit/df6f10608116674643a3cc4bf18819eeee016d42.

{{repo link
| site   = gh
| user   = Juanvvc
| repo   = c172p-detailed
| view   = commit
| commit = df6f10608116674643a3cc4bf18819eeee016d42
}}.

github/Juanvvc/c172p-detailed/df6f10608116674643a3cc4bf18819eeee016d42 commit view.

Tree view at a given commit

This is for https://github.com/Juanvvc/c172p-detailed/tree/df6f10608116674643a3cc4bf18819eeee016d42.

{{repo link
| site   = gh
| user   = Juanvvc
| repo   = c172p-detailed
| view   = tree
| commit = df6f10608116674643a3cc4bf18819eeee016d42
}}.

github/Juanvvc/c172p-detailed/df6f10608116674643a3cc4bf18819eeee016d42.

Main views

History view

This is for https://github.com/Juanvvc/c172p-detailed/commits/master.

{{repo link
| site   = gh
| user   = Juanvvc
| repo   = c172p-detailed
| view   = commits
}}.

github/Juanvvc/c172p-detailed/master history view.

History view from a commit

This is for https://github.com/Juanvvc/c172p-detailed/commits/df6f10608116674643a3cc4bf18819eeee016d42.

{{repo link
| site   = gh
| user   = Juanvvc
| repo   = c172p-detailed
| view   = commits
| commit = df6f10608116674643a3cc4bf18819eeee016d42
}}.

github/Juanvvc/c172p-detailed/df6f10608116674643a3cc4bf18819eeee016d42 history view.

Zip archive download

Default

This is for https://github.com/Juanvvc/c172p-detailed/archive/master.zip.

{{repo link
| site = github
| proj = Juanvvc
| repo = c172p-detailed
| type = zip
| full = 1
}}.

https://github.com/Juanvvc/c172p-detailed/archive/master.zip.

Branch

This is for https://github.com/Juanvvc/c172p-detailed/archive/release/2016.1.zip.

{{repo link
| site   = github
| proj   = Juanvvc
| repo   = c172p-detailed
| branch = release/2016.1
| type   = zip
| full   = 1
}}.

https://github.com/Juanvvc/c172p-detailed/archive/release/2016.1.zip.

Commit

This is for https://github.com/Juanvvc/c172p-detailed/archive/c9cef81a899201802b32109c43ca686bbeffdb42.zip.

{{repo link
| site   = github
| proj   = Juanvvc
| repo   = c172p-detailed
| commit = c9cef81a899201802b32109c43ca686bbeffdb42
| type   = zip
| full   = 1
}}.

https://github.com/Juanvvc/c172p-detailed/archive/c9cef81a899201802b32109c43ca686bbeffdb42.zip.

GitLab examples

The FlightGear Multiplayer server software

This should produce git clone https://gitlab.com/fgms/fgms-0-x.git.

{{#tag:syntaxhighlight|
{{repo link
  | site = gitlab
  | cmd  = git clone
  | proj = fgms
  | repo = fgms-0-x
  | type = git
  | full = 1
}}
| lang = "sh"
}}
git clone https://gitlab.com/fgms/fgms-0-x.git

Zip archive download

This is for https://gitlab.com/extra500/extra500/repository/archive.zip?ref=FG/2016.1.

{{repo link
| site   = gitlab
| proj   = extra500
| repo   = extra500
| branch = FG/2016.1
| type   = zip
| full   = 1
}}

https://gitlab.com/extra500/extra500/repository/archive.zip?ref=FG/2016.1

Gitorious archive examples

Note  The Gitorious open source infrastructure is locked in a read-only archived state.

The old FlightGear source repository

This is for the archived flightgear repository at https://gitorious.org/fg/flightgear.git. The automatically created URL, which is equivalent, should be https://gitorious.org/fg/flightgear?p=fg:flightgear.git;a=summary.

{{repo link
| site = gito
| proj = fg
| repo = flightgear
| text = The archived flightgear source code repository at Gitorious
}}.

The archived flightgear source code repository at Gitorious.

The historic fgdata repository

This is for the historic repository https://gitorious.org/fg/fgdata.git. The automatically created URL, which is equivalent, should be https://gitorious.org/fg/fgdata?p=fg:fgdata.git;a=summary.


{{repo link
| site = gito
| proj = fg
| repo = fgdata
| text = The archived fgdata repository at Gitorious, with full history from 2000-2015
}}.

The archived fgdata repository at Gitorious, with full history from 2000-2015.

Git clone

This is for cloning the historic fgdata repository with git clone https://gitorious.org/fg/fgdata.git.

{{#tag:code|{{#tag:nowiki|{{repo link
  | site     = gito
  | cmd      = git clone
  | proj     = fg
  | repo     = fgdata
  | type     = git
  | full     = 1
}}}}}}.

git clone https://gitorious.org/fg/fgdata.git.

File with line number

This is for https://gitorious.org/fg/hoorays-fgdata?p=fg:hoorays-fgdata.git;a=blob;f=Nasal/ai/ai.nas;hb=refs/heads/topics/scriptable-ai-submodule#l1.

{{repo link
| site   = gito
| proj   = fg
| repo   = hoorays-fgdata
| view   = blob
| branch = topics/scriptable-ai-submodule
| path   = Nasal/ai/ai.nas
| line   = 1
| text   = Scripted AI Objects repo
}}.

Scripted AI Objects repo.

File prefixed with $NASAL_SRC

This is for https://gitorious.org/fg/hoorays-fgdata?p=fg:hoorays-fgdata.git;a=blob;f=Nasal/ai/ai.nas;hb=refs/heads/topics/scriptable-ai-submodule.

{{repo link
| site       = gito
| proj       = fg
| repo       = hoorays-fgdata
| view       = blob
| branch     = topics/scriptable-ai-submodule
| path       = Nasal/ai/ai.nas
| pre        = $NASAL_SRC
| simplepath = 1
}}.

$NASAL_SRC/Nasal/ai/ai.nas.

Raw view

This is for https://gitorious.org/fg/hoorays-fgdata?p=fg:hoorays-fgdata.git;a=blob_plain;f=Nasal/ai/ai.nas;hb=refs/heads/topics/scriptable-ai-submodule.

{{repo link
| site   = gito
| proj   = fg
| repo   = hoorays-fgdata
| view   = raw
| branch = topics/scriptable-ai-submodule
| path   = Nasal/ai/ai.nas
| full   = 1
}}.

https://gitorious.org/fg/hoorays-fgdata?p=fg:hoorays-fgdata.git;a=blob_plain;f=Nasal/ai/ai.nas;hb=refs/heads/topics/scriptable-ai-submodule.

Commit

This is for https://gitorious.org/nasal-standalone/nasal-experiments?p=nasal-standalone:nasal-experiments.git;a=commit;h=9b2d59c316d03b83cfb4352a38b865aa29f4c280.

{{repo link
| site   = gito
| proj   = nasal-standalone
| repo   = nasal-experiments
| view   = commit
| commit = 9b2d59c316d03b83cfb4352a38b865aa29f4c280
| pre    = $NASAL_SRC
}}.

$NASAL_SRC.

Commit with file path

This is for https://gitorious.org/fg/fgdata?p=fg:fgdata.git;a=blob;f=Nasal/canvas/map/TFC.lcontroller;hb=c78b2f936891bffad49e27d84d952a0d45540eef

{{repo link
| site   = gito
| proj   = fg
| repo   = fgdata
| path   = Nasal/canvas/map/TFC.lcontroller
| view   = blob
| commit = c78b2f936891bffad49e27d84d952a0d45540eef
| full   = 1
}}.

https://gitorious.org/fg/fgdata?p=fg:fgdata.git;a=blob;f=Nasal/canvas/map/TFC.lcontroller;hb=c78b2f936891bffad49e27d84d952a0d45540eef.

Commitdiff

This is for https://gitorious.org/nasal-standalone/nasal-experiments?p=nasal-standalone:nasal-experiments.git;a=commitdiff;h=9b2d59c316d03b83cfb4352a38b865aa29f4c280.

{{repo link
| site   = gito
| proj   = nasal-standalone
| repo   = nasal-experiments
| view   = commitdiff
| commit = 9b2d59c316d03b83cfb4352a38b865aa29f4c280
| pre    = $NASAL_SRC
}}.

$NASAL_SRC.

Main views

Summary view

This is for https://gitorious.org/fg/fgdata?p=fg:fgdata.git;a=summary.

{{repo link
| site = gito
| proj = fg
| repo = fgdata
| view = summary
| full = 1
}}.

https://gitorious.org/fg/fgdata?p=fg:fgdata.git;a=summary.

Shortlog view

This is for https://gitorious.org/fg/fgdata?p=fg:fgdata.git;a=shortlog.

{{repo link
| site = gito
| proj = fg
| repo = fgdata
| view = shortlog
| full = 1
}}.

https://gitorious.org/fg/fgdata?p=fg:fgdata.git;a=shortlog.

Log view

This is for https://gitorious.org/fg/fgdata?p=fg:fgdata.git;a=log;h=4c03a4968d2844c9c8ba734116da3478a1bebb38.

{{repo link
| site   = gito
| proj   = fg
| repo   = fgdata
| view   = log
| commit = 4c03a4968d2844c9c8ba734116da3478a1bebb38
| full   = 1
}}.

https://gitorious.org/fg/fgdata?p=fg:fgdata.git;a=log;h=4c03a4968d2844c9c8ba734116da3478a1bebb38.

Log with branch

This is for https://gitorious.org/fg/hoorays-flightgear?p=fg:hoorays-flightgear.git;a=log;h=refs/heads/topics/ada-support.

{{repo link
| site   = gito
| proj   = fg
| repo   = hoorays-flightgear
| view   = log
| branch = topics/ada-support
| full   = 1
}}.

https://gitorious.org/fg/hoorays-flightgear?p=fg:hoorays-flightgear.git;a=log;h=refs/heads/topics/ada-support.

Generic repository handling

OpenSceneGraph svn repository

This should create svn co http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk osg.

{{#tag:code|{{#tag:nowiki|{{repo link
| site     = svn.openscenegraph.org
| cmd      = svn co
| protocol = http
| type     = svn
| proj     = osg
| repo     = OpenSceneGraph
| post     = osg
| full     = 1
}}}}}}.

svn co http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk osg.

Related templates

See also