From bef4546223702d72788f22deb53fc723df3b2006 Mon Sep 17 00:00:00 2001 From: hassansin Date: Wed, 11 Jul 2018 19:49:12 +0600 Subject: [PATCH] show commits in reverse order and show full SHA --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index afe843d..8e72237 100644 --- a/main.go +++ b/main.go @@ -294,8 +294,9 @@ func parseConfig(data []byte) (string, string) { func releaseNotes(title string, commits []github.RepositoryCommit) string { notes := "" - for _, c := range commits { - notes += fmt.Sprintf("* [%v] - %v\n", (*c.SHA)[0:6], *c.Commit.Message) + for i := len(commits) - 1; i >= 0; i-- { + lines := strings.Split(*commits[i].Commit.Message, "\n") + notes += fmt.Sprintf("* [%v] - %v\n", *commits[i].SHA, lines[0]) } return fmt.Sprintf(`%v # Please enter the realease title as the first line. Lines starting