Template:Commit

From The Dreaming
Revision as of 10:22, 13 September 2016 by Stuart (talk | contribs) (Template cribbed from Blue Prism (well, I wrote it))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Creates a link to a commit in the current web frontend to our versioning repository.

Usage

The mandatory first parameter is the commit ID to link to. A second optional parameter can specify a different project - by default, this will assume the automate project.

Partial IDs are allowed as long as the web URL supports - for git, they work fine - typically the first 6-8 digits of the SHA1 hash will suffice as a unique ID for the commit.

Examples

To link to commit 4ebaad524 in automate :-

 {{commit|4ebaad524}}

which results in: commit 4ebaad524

To link to commit fe3940b128 in the qacontrol repo, use:

 {{commit|fe3940b128|qacontrol}}

which results in: (qacontrol) commit fe3940b128

This will not show the project name if the project is automate. You can force it to show it then by passing a showproject=yes parameter, eg.

 {{commit|4ebaad524|showproject=yes}}

will output: (automate) commit 4ebaad524

Equally, a parameter of showproject=no will override the outputting of the project in non-automate calls. For example:

 {{commit|fe3940b128|qacontrol|showproject=no}}

will produce: commit fe3940b128