Skip to content

Commit

Permalink
fix(changelog): include first release (tag) to history
Browse files Browse the repository at this point in the history
  • Loading branch information
zbindenren committed Jan 12, 2021
1 parent 8488970 commit f37a1f1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions internal/cmd/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func (c Command) runHistory(dst io.Writer, l *flash.Logger, cfg config.Changelog
}

max := len(tags) - 1

if *c.sinceTag != "" {
max = tags.Index(*c.sinceTag)

Expand All @@ -24,8 +25,16 @@ func (c Command) runHistory(dst io.Writer, l *flash.Logger, cfg config.Changelog
}
}

for i := 0; i < max; i++ {
revs, err := g.RevList(tags[i+1], tags[i])
for i := 0; i <= max; i++ {
var start string

end := tags[i]

if i+1 < len(tags) {
start = tags[i+1]
}

revs, err := g.RevList(start, end)
if err != nil {
return err
}
Expand Down

0 comments on commit f37a1f1

Please sign in to comment.