Skip to content

Commit 03fa2ec

Browse files
authored
Use chronological commit order in default squash message (#13661) (#13696)
1 parent 57fa9b0 commit 03fa2ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

services/pull/pull.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ func GetCommitMessages(pr *models.PullRequest) string {
556556
authorsMap := map[string]bool{}
557557
authors := make([]string, 0, list.Len())
558558
stringBuilder := strings.Builder{}
559-
element := list.Front()
559+
// commits list is in reverse chronological order
560+
element := list.Back()
560561
for element != nil {
561562
commit := element.Value.(*git.Commit)
562563

@@ -581,7 +582,7 @@ func GetCommitMessages(pr *models.PullRequest) string {
581582
authors = append(authors, authorString)
582583
authorsMap[authorString] = true
583584
}
584-
element = element.Next()
585+
element = element.Prev()
585586
}
586587

587588
// Consider collecting the remaining authors

0 commit comments

Comments
 (0)