Changelog: invert commit order and, if only one tag exists, use all commits before it
This commit is contained in:
parent
325d9d5434
commit
4f82158528
12
jfmod.gradle
12
jfmod.gradle
|
@ -94,11 +94,13 @@ if (grgit != null) {
|
|||
ext.currentType = VersionType.ALPHA
|
||||
break
|
||||
}
|
||||
if (tagList.size() >= 2) {
|
||||
changelogStr += "Commits in " + ext.currentType.toString().toLowerCase() + " " + ext.currentVer + ":\n"
|
||||
for (def commit : grgit.log{range(tagList.get(1).fullName, tagList.get(0).fullName)}) {
|
||||
changelogStr += "- " + commit.shortMessage + "\n"
|
||||
}
|
||||
def commits = new ArrayList<>(tagList.size() >= 2
|
||||
? grgit.log{range(tagList.get(1).fullName, tagList.get(0).fullName)}
|
||||
: grgit.log(includes: [grgit.tag.list().get(0).fullName]))
|
||||
Collections.reverse(commits)
|
||||
changelogStr += "Commits in " + ext.currentType.toString().toLowerCase() + " " + ext.currentVer + ":\n"
|
||||
for (def commit : commits) {
|
||||
changelogStr += "- " + commit.shortMessage + "\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue