From 041ec1330a999aa77b6abc71f8b6f2f5204d0017 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 3 Apr 2025 18:54:56 +0800 Subject: HTML: Add contribution guidelines in the MR tab --- http_handle_repo_index.go | 2 -- http_server.go | 3 +++ templates/repo_contrib_index.tmpl | 22 +++++++++++++++------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/http_handle_repo_index.go b/http_handle_repo_index.go index 4a60af1..164fd65 100644 --- a/http_handle_repo_index.go +++ b/http_handle_repo_index.go @@ -95,8 +95,6 @@ func httpHandleRepoIndex(w http.ResponseWriter, req *http.Request, params map[st 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 0a474cc..e234d64 100644 --- a/http_server.go +++ b/http_server.go @@ -190,6 +190,9 @@ func (router *forgeHTTPRouter) ServeHTTP(writer http.ResponseWriter, request *ht 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 a4c5098..c7ae45c 100644 --- a/templates/repo_contrib_index.tmpl +++ b/templates/repo_contrib_index.tmpl @@ -43,18 +43,26 @@ {{- .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 -}} -- cgit v1.2.3
Merge requests
IDTitleStatus
IDTitleStatus