Skip to content

Commit

Permalink
[TC] Add some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPl292 committed Jul 27, 2023
1 parent 6967416 commit bef928a
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,16 @@ fun main(args: Array<String>) {
val (lastVersion, objectId) = getVersion(projectDir, onlyStable = true)
println("Last version: $lastVersion, hash: ${objectId.name}")

val branch = getRepo(projectDir).branch
check(branch == "master") {
"We should be on master branch"
}
val git = getGit(projectDir)
val logDiff = git.log().setMaxCount(500).call().takeWhile { it.id.name != objectId.name }
val log = git.log().setMaxCount(500).call()
println("First commit hash in log: " + log.first().name)
val logDiff = log.takeWhile { it.id.name != objectId.name }
val numCommits = logDiff.size
println("Log diff size is $numCommits")
check(numCommits < 450) {
"More than 450 commits detected since the last release. This is suspicious."
}
Expand Down

0 comments on commit bef928a

Please sign in to comment.