summaryrefslogtreecommitdiffstats
path: root/templates/repo/issue/view_content/pull_merge_instruction.tmpl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
committerDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
commitdd136858f1ea40ad3c94191d647487fa4f31926c (patch)
tree58fec94a7b2a12510c9664b21793f1ed560c6518 /templates/repo/issue/view_content/pull_merge_instruction.tmpl
parentInitial commit. (diff)
downloadforgejo-dd136858f1ea40ad3c94191d647487fa4f31926c.tar.xz
forgejo-dd136858f1ea40ad3c94191d647487fa4f31926c.zip
Adding upstream version 9.0.0.upstream/9.0.0upstreamdebian
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'templates/repo/issue/view_content/pull_merge_instruction.tmpl')
-rw-r--r--templates/repo/issue/view_content/pull_merge_instruction.tmpl57
1 files changed, 57 insertions, 0 deletions
diff --git a/templates/repo/issue/view_content/pull_merge_instruction.tmpl b/templates/repo/issue/view_content/pull_merge_instruction.tmpl
new file mode 100644
index 0000000..b7aae53
--- /dev/null
+++ b/templates/repo/issue/view_content/pull_merge_instruction.tmpl
@@ -0,0 +1,57 @@
+<div class="divider"></div>
+<details class="collapsible">
+ <summary class="tw-py-2"> {{ctx.Locale.Tr "repo.pulls.cmd_instruction_hint"}} </summary>
+ <div><h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_title"}}</h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_desc"}}</div>
+ {{$localBranch := .PullRequest.HeadBranch}}
+ {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}
+ {{$localBranch = print .PullRequest.HeadRepo.OwnerName "-" .PullRequest.HeadBranch}}
+ {{end}}
+ <div class="ui secondary segment">
+ {{if eq .PullRequest.Flow 0}}
+ <div>git fetch -u {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}<origin-url data-url="{{.PullRequest.HeadRepo.Link}}"></origin-url>{{else}}origin{{end}} {{.PullRequest.HeadBranch}}:{{$localBranch}}</div>
+ {{else}}
+ <div>git fetch -u origin +refs/pull/{{.PullRequest.Index}}/head:{{$localBranch}}</div>
+ {{end}}
+ <div>git checkout {{$localBranch}}</div>
+ </div>
+ {{if .ShowMergeInstructions}}
+ <div id="merge-instructions">
+ <h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}</h3>
+ {{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}}
+ {{if not .AutodetectManualMerge}}
+ <p>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_warning"}}</p>
+ {{end}}
+ </div>
+ <div class="ui secondary segment">
+ <div data-pull-merge-style="merge">
+ <div>git checkout {{.PullRequest.BaseBranch}}</div>
+ <div>git merge --no-ff {{$localBranch}}</div>
+ </div>
+ <div class="tw-hidden" data-pull-merge-style="rebase">
+ <div>git checkout {{$localBranch}}</div>
+ <div>git rebase {{.PullRequest.BaseBranch}}</div>
+ <div>git checkout {{.PullRequest.BaseBranch}}</div>
+ <div>git merge --ff-only {{$localBranch}}</div>
+ </div>
+ <div class="tw-hidden" data-pull-merge-style="rebase-merge">
+ <div>git checkout {{$localBranch}}</div>
+ <div>git rebase {{.PullRequest.BaseBranch}}</div>
+ <div>git checkout {{.PullRequest.BaseBranch}}</div>
+ <div>git merge --no-ff {{$localBranch}}</div>
+ </div>
+ <div class="tw-hidden" data-pull-merge-style="squash">
+ <div>git checkout {{.PullRequest.BaseBranch}}</div>
+ <div>git merge --squash {{$localBranch}}</div>
+ </div>
+ <div class="tw-hidden" data-pull-merge-style="fast-forward-only">
+ <div>git checkout {{.PullRequest.BaseBranch}}</div>
+ <div>git merge --ff-only {{$localBranch}}</div>
+ </div>
+ <div class="tw-hidden" data-pull-merge-style="manually-merged">
+ <div>git checkout {{.PullRequest.BaseBranch}}</div>
+ <div>git merge {{$localBranch}}</div>
+ </div>
+ <div>git push origin {{.PullRequest.BaseBranch}}</div>
+ </div>
+ {{end}}
+</details>