From 041ec1330a999aa77b6abc71f8b6f2f5204d0017 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 03 Apr 2025 18:54:56 +0800 Subject: [PATCH] HTML: Add contribution guidelines in the MR tab --- http_handle_repo_index.go | 2 -- http_server.go | 3 +++ templates/repo_contrib_index.tmpl | 22 +++++++++++++++------- diff --git a/http_handle_repo_index.go b/http_handle_repo_index.go index 4a60af1de8c68b17310e01567455fd3eaae4d879..164fd65ff6d5fe9fb308868c37cd8de86a135032 100644 --- a/http_handle_repo_index.go +++ b/http_handle_repo_index.go @@ -95,8 +95,6 @@ params["commits"] = commits params["readme_filename"] = readmeFilename params["readme"] = readmeRendered - params["http_clone_url"] = genHTTPRemoteURL(groupPath, repoName) - params["ssh_clone_url"] = genSSHRemoteURL(groupPath, repoName) params["notes"] = notes renderTemplate(w, "repo_index", params) diff --git a/http_server.go b/http_server.go index 0a474ccfcb283e2a36f8889c76e43ae1be6aafa1..e234d642badcab3069804a244fb4392f01d9c2a8 100644 --- a/http_server.go +++ b/http_server.go @@ -190,6 +190,9 @@ for _, part := range segments[:sepIndex+3] { repoURLRoot = repoURLRoot + url.PathEscape(part) + "/" } params["repo_url_root"] = repoURLRoot + params["repo_patch_mailing_list"] = repoURLRoot[1:] + "@" + config.LMTP.Domain + params["http_clone_url"] = genHTTPRemoteURL(groupPath, moduleName) + params["ssh_clone_url"] = genSSHRemoteURL(groupPath, moduleName) if len(segments) == sepIndex+3 { if redirectDir(writer, request) { diff --git a/templates/repo_contrib_index.tmpl b/templates/repo_contrib_index.tmpl index a4c5098f81c7f7186315580481a3aa627364334a..c7ae45cbd1aeb9473cca619bbe88f9a446c2d274 100644 --- a/templates/repo_contrib_index.tmpl +++ b/templates/repo_contrib_index.tmpl @@ -44,17 +44,25 @@ {{- .repo_description -}}
+

How to submit a merge request

+
git clone {{ .ssh_clone_url }}
+cd powxy
+git checkout -b contrib/name_of_your_contribution
+# edit and commit stuff
+git push -u origin HEAD
+

Pushes that update branches in other namespaces, or pushes to existing contribution branches belonging to other SSH keys, will be automatically +rejected, unless you are an authenticated maintainer. Otherwise, a merge request is automatically opened, and the maintainers are notified via IRC.

+

Alternatively, you may email patches to {{ .repo_patch_mailing_list }}.

+
+
- - + + + + - - - - - {{- range .merge_requests -}} -- 2.48.1
Merge requests
IDTitleStatus
IDTitleStatus