Skip to content

Instantly share code, notes, and snippets.

@rxbynerd
Created March 24, 2014 22:46
Show Gist options
  • Save rxbynerd/9750992 to your computer and use it in GitHub Desktop.
Save rxbynerd/9750992 to your computer and use it in GitHub Desktop.
#!/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