Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Removes the commit messages that reference merging pull requests from logs
// 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()) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment