Skip to content

Commit d25d917

Browse files
committed
Standardize Co-Authored-By / Reviewed-By strings
1 parent addd424 commit d25d917

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
9595
- `DEFAULT_MERGE_MESSAGE_COMMITS_LIMIT`: **50**: In the default merge message for squash commits include at most this many commits. Set to `-1` to include all commits
9696
- `DEFAULT_MERGE_MESSAGE_SIZE`: **5120**: In the default merge message for squash commits limit the size of the commit messages. Set to `-1` to have no limit.
9797
- `DEFAULT_MERGE_MESSAGE_ALL_AUTHORS`: **false**: In the default merge message for squash commits walk all commits to include all authors in the Co-authored-by otherwise just use those in the limited list
98-
- `DEFAULT_MERGE_MESSAGE_MAX_APPROVERS`: **10**: In default merge messages limit the number of approvers listed as `Reviewed-by:`. Set to `-1` to include all.
98+
- `DEFAULT_MERGE_MESSAGE_MAX_APPROVERS`: **10**: In default merge messages limit the number of approvers listed as `Reviewed-By:`. Set to `-1` to include all.
9999
- `DEFAULT_MERGE_MESSAGE_OFFICIAL_APPROVERS_ONLY`: **true**: In default merge messages only include approvers who are officially allowed to review.
100100

101101
### Repository - Issue (`repository.issue`)

models/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ func (pr *PullRequest) getReviewedByLines(writer io.Writer) error {
286286
} else if review.Reviewer == nil {
287287
continue
288288
}
289-
if _, err := writer.Write([]byte("Reviewed-by: ")); err != nil {
289+
if _, err := writer.Write([]byte("Reviewed-By: ")); err != nil {
290290
return err
291291
}
292292
if _, err := writer.Write([]byte(review.Reviewer.NewGitSig().String())); err != nil {

services/pull/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ func GetSquashMergeCommitMessages(pr *models.PullRequest) string {
611611
}
612612

613613
for _, author := range authors {
614-
if _, err := stringBuilder.Write([]byte("Co-authored-by: ")); err != nil {
614+
if _, err := stringBuilder.Write([]byte("Co-Authored-By: ")); err != nil {
615615
log.Error("Unable to write to string builder Error: %v", err)
616616
return ""
617617
}

services/webhook/matrix_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ func TestMatrixPullRequestPayload(t *testing.T) {
8484
func TestMatrixHookRequest(t *testing.T) {
8585
h := &models.HookTask{
8686
PayloadContent: `{
87-
"body": "[[user1/test](http://localhost:3000/user1/test)] user1 pushed 1 commit to [master](http://localhost:3000/user1/test/src/branch/master):\n[5175ef2](http://localhost:3000/user1/test/commit/5175ef26201c58b035a3404b3fe02b4e8d436eee): Merge pull request 'Change readme.md' (#2) from add-matrix-webhook into master\n\nReviewed-on: http://localhost:3000/user1/test/pulls/2\n - user1",
87+
"body": "[[user1/test](http://localhost:3000/user1/test)] user1 pushed 1 commit to [master](http://localhost:3000/user1/test/src/branch/master):\n[5175ef2](http://localhost:3000/user1/test/commit/5175ef26201c58b035a3404b3fe02b4e8d436eee): Merge pull request 'Change readme.md' (#2) from add-matrix-webhook into master\n\nReviewed-On: http://localhost:3000/user1/test/pulls/2\n - user1",
8888
"msgtype": "m.notice",
8989
"format": "org.matrix.custom.html",
90-
"formatted_body": "[\u003ca href=\"http://localhost:3000/user1/test\"\u003euser1/test\u003c/a\u003e] user1 pushed 1 commit to \u003ca href=\"http://localhost:3000/user1/test/src/branch/master\"\u003emaster\u003c/a\u003e:\u003cbr\u003e\u003ca href=\"http://localhost:3000/user1/test/commit/5175ef26201c58b035a3404b3fe02b4e8d436eee\"\u003e5175ef2\u003c/a\u003e: Merge pull request 'Change readme.md' (#2) from add-matrix-webhook into master\n\nReviewed-on: http://localhost:3000/user1/test/pulls/2\n - user1",
90+
"formatted_body": "[\u003ca href=\"http://localhost:3000/user1/test\"\u003euser1/test\u003c/a\u003e] user1 pushed 1 commit to \u003ca href=\"http://localhost:3000/user1/test/src/branch/master\"\u003emaster\u003c/a\u003e:\u003cbr\u003e\u003ca href=\"http://localhost:3000/user1/test/commit/5175ef26201c58b035a3404b3fe02b4e8d436eee\"\u003e5175ef2\u003c/a\u003e: Merge pull request 'Change readme.md' (#2) from add-matrix-webhook into master\n\nReviewed-On: http://localhost:3000/user1/test/pulls/2\n - user1",
9191
"io.gitea.commits": [
9292
{
9393
"id": "5175ef26201c58b035a3404b3fe02b4e8d436eee",
94-
"message": "Merge pull request 'Change readme.md' (#2) from add-matrix-webhook into master\n\nReviewed-on: http://localhost:3000/user1/test/pulls/2\n",
94+
"message": "Merge pull request 'Change readme.md' (#2) from add-matrix-webhook into master\n\nReviewed-On: http://localhost:3000/user1/test/pulls/2\n",
9595
"url": "http://localhost:3000/user1/test/commit/5175ef26201c58b035a3404b3fe02b4e8d436eee",
9696
"author": {
9797
"name": "user1",
@@ -115,14 +115,14 @@ func TestMatrixHookRequest(t *testing.T) {
115115
}
116116

117117
wantPayloadContent := `{
118-
"body": "[[user1/test](http://localhost:3000/user1/test)] user1 pushed 1 commit to [master](http://localhost:3000/user1/test/src/branch/master):\n[5175ef2](http://localhost:3000/user1/test/commit/5175ef26201c58b035a3404b3fe02b4e8d436eee): Merge pull request 'Change readme.md' (#2) from add-matrix-webhook into master\n\nReviewed-on: http://localhost:3000/user1/test/pulls/2\n - user1",
118+
"body": "[[user1/test](http://localhost:3000/user1/test)] user1 pushed 1 commit to [master](http://localhost:3000/user1/test/src/branch/master):\n[5175ef2](http://localhost:3000/user1/test/commit/5175ef26201c58b035a3404b3fe02b4e8d436eee): Merge pull request 'Change readme.md' (#2) from add-matrix-webhook into master\n\nReviewed-On: http://localhost:3000/user1/test/pulls/2\n - user1",
119119
"msgtype": "m.notice",
120120
"format": "org.matrix.custom.html",
121-
"formatted_body": "[\u003ca href=\"http://localhost:3000/user1/test\"\u003euser1/test\u003c/a\u003e] user1 pushed 1 commit to \u003ca href=\"http://localhost:3000/user1/test/src/branch/master\"\u003emaster\u003c/a\u003e:\u003cbr\u003e\u003ca href=\"http://localhost:3000/user1/test/commit/5175ef26201c58b035a3404b3fe02b4e8d436eee\"\u003e5175ef2\u003c/a\u003e: Merge pull request 'Change readme.md' (#2) from add-matrix-webhook into master\n\nReviewed-on: http://localhost:3000/user1/test/pulls/2\n - user1",
121+
"formatted_body": "[\u003ca href=\"http://localhost:3000/user1/test\"\u003euser1/test\u003c/a\u003e] user1 pushed 1 commit to \u003ca href=\"http://localhost:3000/user1/test/src/branch/master\"\u003emaster\u003c/a\u003e:\u003cbr\u003e\u003ca href=\"http://localhost:3000/user1/test/commit/5175ef26201c58b035a3404b3fe02b4e8d436eee\"\u003e5175ef2\u003c/a\u003e: Merge pull request 'Change readme.md' (#2) from add-matrix-webhook into master\n\nReviewed-On: http://localhost:3000/user1/test/pulls/2\n - user1",
122122
"io.gitea.commits": [
123123
{
124124
"id": "5175ef26201c58b035a3404b3fe02b4e8d436eee",
125-
"message": "Merge pull request 'Change readme.md' (#2) from add-matrix-webhook into master\n\nReviewed-on: http://localhost:3000/user1/test/pulls/2\n",
125+
"message": "Merge pull request 'Change readme.md' (#2) from add-matrix-webhook into master\n\nReviewed-On: http://localhost:3000/user1/test/pulls/2\n",
126126
"url": "http://localhost:3000/user1/test/commit/5175ef26201c58b035a3404b3fe02b4e8d436eee",
127127
"author": {
128128
"name": "user1",

templates/repo/issue/view_content/pull.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@
261261
<input type="text" name="merge_title_field" value="{{.Issue.PullRequest.GetDefaultMergeMessage}}">
262262
</div>
263263
<div class="field">
264-
<textarea name="merge_message_field" rows="5" placeholder="{{$.i18n.Tr "repo.editor.commit_message_desc"}}">Reviewed-on: {{$.Issue.HTMLURL}}&#13;&#10;{{$approvers}}</textarea>
264+
<textarea name="merge_message_field" rows="5" placeholder="{{$.i18n.Tr "repo.editor.commit_message_desc"}}">Reviewed-On: {{$.Issue.HTMLURL}}&#13;&#10;{{$approvers}}</textarea>
265265
</div>
266266
<button class="ui green button" type="submit" name="do" value="merge">
267267
{{$.i18n.Tr "repo.pulls.merge_pull_request"}}
@@ -293,7 +293,7 @@
293293
<input type="text" name="merge_title_field" value="{{.Issue.PullRequest.GetDefaultMergeMessage}}">
294294
</div>
295295
<div class="field">
296-
<textarea name="merge_message_field" rows="5" placeholder="{{$.i18n.Tr "repo.editor.commit_message_desc"}}">Reviewed-on: {{$.Issue.HTMLURL}}&#13;&#10;{{$approvers}}</textarea>
296+
<textarea name="merge_message_field" rows="5" placeholder="{{$.i18n.Tr "repo.editor.commit_message_desc"}}">Reviewed-On: {{$.Issue.HTMLURL}}&#13;&#10;{{$approvers}}</textarea>
297297
</div>
298298
<button class="ui green button" type="submit" name="do" value="rebase-merge">
299299
{{$.i18n.Tr "repo.pulls.rebase_merge_commit_pull_request"}}
@@ -312,7 +312,7 @@
312312
<input type="text" name="merge_title_field" value="{{.Issue.PullRequest.GetDefaultSquashMessage}}">
313313
</div>
314314
<div class="field">
315-
<textarea name="merge_message_field" rows="5" placeholder="{{$.i18n.Tr "repo.editor.commit_message_desc"}}">{{.GetCommitMessages}}Reviewed-on: {{$.Issue.HTMLURL}}&#13;&#10;{{$approvers}}</textarea>
315+
<textarea name="merge_message_field" rows="5" placeholder="{{$.i18n.Tr "repo.editor.commit_message_desc"}}">{{.GetCommitMessages}}Reviewed-On: {{$.Issue.HTMLURL}}&#13;&#10;{{$approvers}}</textarea>
316316
</div>
317317
<button class="ui green button" type="submit" name="do" value="squash">
318318
{{$.i18n.Tr "repo.pulls.squash_merge_pull_request"}}

0 commit comments

Comments
 (0)