Created
March 11, 2020 20:13
-
-
Save adavis/685379c415ffad946c60e85076f68036 to your computer and use it in GitHub Desktop.
Removes the commit messages that reference merging pull requests from logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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