Created
March 24, 2014 22:46
-
-
Save rxbynerd/9750992 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env ruby | |
# so we need to take branch.txt and existing.txt, parse the messages into a hash | |
master = {} | |
mastertext = File.read "/Users/luke/fuckup/master.txt" | |
mastertext.split("\n").each do |line| | |
sha, *message = line.split(" ") | |
message = Array(message).join(" ") | |
master[message] = sha | |
end | |
branchtext = $stdin.read | |
branchtext.split("\n").each do |line| | |
pick, sha, *message = line.split(" ") | |
message = Array(message).join(" ") | |
if master[message] | |
# commit is on master, we don't want that shit | |
puts "# #{line} # commit is on master as #{master[message]}" | |
else | |
# commit is not on master, we want that shit | |
puts line | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment