Skip to content

Commit

Permalink
Use chronological commit order in default squash message (#13661) (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
jpraet authored Nov 25, 2020
1 parent 57fa9b0 commit 03fa2ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions services/pull/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,8 @@ func GetCommitMessages(pr *models.PullRequest) string {
authorsMap := map[string]bool{}
authors := make([]string, 0, list.Len())
stringBuilder := strings.Builder{}
element := list.Front()
// commits list is in reverse chronological order
element := list.Back()
for element != nil {
commit := element.Value.(*git.Commit)

Expand All @@ -581,7 +582,7 @@ func GetCommitMessages(pr *models.PullRequest) string {
authors = append(authors, authorString)
authorsMap[authorString] = true
}
element = element.Next()
element = element.Prev()
}

// Consider collecting the remaining authors
Expand Down

0 comments on commit 03fa2ec

Please sign in to comment.