Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Removes the commit messages that reference merging pull requests from logs
import java.io.File
// Get the passed in file, i.e. "-f some/path" or use the default file name
val file = if (args.contains("-f")) args[1 + args.indexOf("-f")]
else "commit_messages.log"
File("${file}_clean").printWriter().use { out ->
File(file).forEachLine { msg ->
if (msg.startsWith("Merge pull request").not()) {
out.println(msg)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.