From 2c9dd71140474b1f83f068bece40b25e94240ab4 Mon Sep 17 00:00:00 2001 From: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> Date: Tue, 22 Dec 2020 03:19:33 +0100 Subject: [PATCH] Standardize Co-Authored-By / Reviewed-By strings (#14097) * Standardize Co-Authored-By / Reviewed-By strings * Use lowercase variant Co-authored-by: Lunny Xiao --- modules/repofiles/temp_repo.go | 4 ++-- options/locale/locale_en-US.ini | 2 +- services/pull/merge.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/repofiles/temp_repo.go b/modules/repofiles/temp_repo.go index 0d86773643..a02bba65e9 100644 --- a/modules/repofiles/temp_repo.go +++ b/modules/repofiles/temp_repo.go @@ -222,10 +222,10 @@ func (t *TemporaryUploadRepository) CommitTreeWithDate(author, committer *models if committerSig.Name != authorSig.Name || committerSig.Email != authorSig.Email { // Add trailers _, _ = messageBytes.WriteString("\n") - _, _ = messageBytes.WriteString("Co-Authored-By: ") + _, _ = messageBytes.WriteString("Co-authored-by: ") _, _ = messageBytes.WriteString(committerSig.String()) _, _ = messageBytes.WriteString("\n") - _, _ = messageBytes.WriteString("Co-Committed-By: ") + _, _ = messageBytes.WriteString("Co-committed-by: ") _, _ = messageBytes.WriteString(committerSig.String()) _, _ = messageBytes.WriteString("\n") } diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 1d43c03017..d7d6b751f6 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1525,7 +1525,7 @@ settings.trust_model.collaborator.long = Collaborator: Trust signatures by colla settings.trust_model.collaborator.desc = Valid signatures by collaborators of this repository will be marked "trusted" - (whether they match the committer or not). Otherwise, valid signatures will be marked "untrusted" if the signature matches the committer and "unmatched" if not. settings.trust_model.committer = Committer settings.trust_model.committer.long = Committer: Trust signatures that match committers (This matches GitHub and will force Gitea signed commits to have Gitea as the committer) -settings.trust_model.committer.desc = Valid signatures will only be marked "trusted" if they match the committer, otherwise they will be marked "unmatched". This will force Gitea to be the committer on signed commits with the actual committer marked as Co-Authored-By: and Co-Committed-By: trailer in the commit. The default Gitea key must match a User in the database. +settings.trust_model.committer.desc = Valid signatures will only be marked "trusted" if they match the committer, otherwise they will be marked "unmatched". This will force Gitea to be the committer on signed commits with the actual committer marked as Co-authored-by: and Co-committed-by: trailer in the commit. The default Gitea key must match a User in the database. settings.trust_model.collaboratorcommitter = Collaborator+Committer settings.trust_model.collaboratorcommitter.long = Collaborator+Committer: Trust signatures by collaborators which match the committer settings.trust_model.collaboratorcommitter.desc = Valid signatures by collaborators of this repository will be marked "trusted" if they match the committer. Otherwise, valid signatures will be marked "untrusted" if the signature matches the committer and "unmatched" otherwise. This will force Gitea to be marked as the committer on signed commits with the actual committer marked as Co-Authored-By: and Co-Committed-By: trailer in the commit. The default Gitea key must match a User in the database. diff --git a/services/pull/merge.go b/services/pull/merge.go index 2c4f939e0a..9d6eadc524 100644 --- a/services/pull/merge.go +++ b/services/pull/merge.go @@ -353,7 +353,7 @@ func rawMerge(pr *models.PullRequest, doer *models.User, mergeStyle models.Merge } else { if committer != sig { // add trailer - message += fmt.Sprintf("\nCo-Authored-By: %s\nCo-Committed-By: %s\n", sig.String(), sig.String()) + message += fmt.Sprintf("\nCo-authored-by: %s\nCo-committed-by: %s\n", sig.String(), sig.String()) } if err := git.NewCommand("commit", signArg, fmt.Sprintf("--author='%s <%s>'", sig.Name, sig.Email), "-m", message).RunInDirTimeoutEnvPipeline(env, -1, tmpBasePath, &outbuf, &errbuf); err != nil { log.Error("git commit [%s:%s -> %s:%s]: %v\n%s\n%s", pr.HeadRepo.FullName(), pr.HeadBranch, pr.BaseRepo.FullName(), pr.BaseBranch, err, outbuf.String(), errbuf.String())