Skip to content

Commit

Permalink
Updates release notes generator
Browse files Browse the repository at this point in the history
The git log is actually

```
commit <hash>
Merge Pull Request ...

<body>
```

Which is now parsed correctly

Signed-off-by: Chuck Ha <chuckh@vmware.com>
  • Loading branch information
chuckha committed Sep 6, 2019
1 parent 203d8f7 commit 9d741d1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions hack/tools/release/notes.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ func run() int {
for i := 0; i < len(outLines); i++ {
line := strings.TrimSpace(outLines[i])
switch {
case line == "":
case strings.HasPrefix(line, "commit"):
commits = append(commits, c)
c = commit{}
case strings.HasPrefix(line, "Merge"):
c.merge = line
case strings.HasPrefix(line, "commit"):
continue
case line == "":
default:
c.body = line
}
Expand All @@ -131,7 +131,10 @@ func run() int {
if key != unknown {
c.body = c.body[len(firstWord):]
}
c.body = fmt.Sprintf(" - %s", strings.TrimSpace(c.body))
if strings.TrimSpace(c.body) == "" {
continue
}
c.body = fmt.Sprintf("- %s", strings.TrimSpace(c.body))
fmt.Sscanf(c.merge, "Merge pull request %s from %s", &prNumber, &fork)
merges[key] = append(merges[key], formatMerge(c.body, prNumber))
}
Expand Down

0 comments on commit 9d741d1

Please sign in to comment.