「テンプレート:GitCommit」の版間の差分

提供: wiki
移動先: 案内検索
(Working code (wiki templates...))
 
 
(同じ利用者による、間の1版が非表示)
1行目: 1行目:
<includeonly>[http://developer.blender.org/{{#ifeq: r | {{padleft: | 1 | {{{1}}} }} | | r{{#switch: {{{2}}} | addons = BA | addons contrib = BAC | translations = BT | phabricator = P | scons = S | blender | B }} }}{{{1}}} {{{1}}}]</includeonly><!--
+
<includeonly>[https://projects.blender.org/<!--
--><noinclude>{{Documentation}}</noinclude>
+
    If third param is defined, new recommended usage: fork/repo/commit/1234567890.
 +
-->{{#if:{{{3|}}}|{{{3}}}/{{{2}}}/commit/{{{1}}} {{#sub:{{{1}}}|0|15}}]|<!--
 +
                  Else, check for `rBAC1234567890` Phabricator-like commit references.
 +
              -->{{#ifeq: {{{1}}} | {{Template:GitCommit/PhabricatorParse|{{{1}}}}} | <!--
 +
                                  The commit reference did not match any known Phabricator pattern.
 +
                              -->{{#ifeq: {{{2}}} | {{Template:GitCommit/PhabricatorParseDeprecated|{{{1}}}|{{{2}}}}} | <!--
 +
                                                    The commit reference did not match any known deprecated repo name,
 +
                                                    assume it's a valid repository name and commit hash,
 +
                                                    or just a commit hash in official main Blender repo.
 +
                                                  -->blender/{{#if:{{{2|}}}|{{{2}}}|blender}}/commit/{{{1}}} {{#sub:{{{1}}}|0|15}}] |<!--
 +
                                                    The commit reference did match a known deprecated repo name, use the sub-template result.
 +
                                                  -->{{Template:GitCommit/PhabricatorParseDeprecated|{{{1}}}|{{{2}}}}} {{#sub:{{{1}}}|0|15}}] <!--
 +
                              -->}}<!--
 +
                                  The commit reference did match a known Phabricator pattern, use the sub-template result.
 +
                              -->|{{Template:GitCommit/PhabricatorParse|{{{1}}}}} {{#sub:{{{1}}}|0|15}}] <!--
 +
              -->}}<!--
 +
-->}}</includeonly><!--
 +
--><noinclude>{{Template:GitCommit/doc}}</noinclude>

2023年2月14日 (火) 04:13時点における最新版

Template to link to commits in GIT, useful for writing release notes.

Long SHAs are automatically shortened.

Commit a9e0f3364fd93c5 in blender/blender:

{{GitCommit|a9e0f3364fd93c51bd004d46b7b859d55b20a7b8}}

Explicit Fork & Repo References

An explicit repository name and commit hash is the recommended way to create links to commits, as it is reasonably un-ambiguous:

Commit a9e0f3364fd9 in blender/blender:

{{GitCommit|a9e0f3364fd9|blender}}

Commit 78b0fc30b6 in blender/blender-addons:

{{GitCommit|78b0fc30b6|blender-addons}}

Commit 65ff08e325 in blender/blender-addons-contrib:

{{GitCommit|65ff08e325|blender-addons-contrib}}

For organizations different than the default Blender one, or for forks, a third parameter can be provided:

Commit 55bfc8db88 in studio/flamenco:

{{GitCommit|55bfc8db88|flamenco|studio}}

Commit 4d3bfb3f41 in mont29/blender:

{{GitCommit|4d3bfb3f41|blender|mont29}}

Phabricator-like References

The rXXX12345678 format as it existed in Phabricator is still supported for git repositories:

Commit rBa9e0f3364fd9 in blender/blender:

{{GitCommit|rBa9e0f3364fd9}}

Commit rBA8078c1a024dc in blender/blender-addons:

{{GitCommit|rBA8078c1a024dc}}

Commit rBAC65ff08e325 in blender/blender-addons-contrib:

{{GitCommit|rBAC65ff08e325}}

It will remap to the proper organization when needed:

Commit rF55bfc8db88 in studio/flamenco:

{{GitCommit|rF55bfc8db88}}

This used to works for svn commits, however with Gitea, svn repositories are not exposed that way anymore, so an invalid link is generated:

Commit rBM244 in blender manual:

{{GitCommit|rBM244}}

See Template:GitCommit/PhabricatorParse for more details.

Commit Hash Only

With only a commit hash parameter, this template creates a link to the main official Blender repository:

Commit a9e0f3364fd9 in blender/blender:

{{GitCommit|a9e0f3364fd9}}

Other References

Some other types of references are only supported for historical reasons and should never be used in new wiki text, see Template:GitCommit/PhabricatorParseDeprecated for details.