Skip to content

Instantly share code, notes, and snippets.

@betesh
Created April 21, 2017 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save betesh/5df1fc852182ec6bab40aa000fd7db49 to your computer and use it in GitHub Desktop.
Save betesh/5df1fc852182ec6bab40aa000fd7db49 to your computer and use it in GitHub Desktop.
# /usr/bin/env ruby
PAIRS = [
["SHA1_ON_NEW_BRANCH", "SHA1_ON_ORIGINAL_BRANCH"],
# etc...
]
PAIRS.each do |pair|
cmd = "bash -c 'diff <(git show #{pair[0]} -U0 --format=\"\" | grep -v \"^index\") <(git show #{pair[1]} -U0 --format=\"\" | grep -v \"^index\") | grep -v \"> @@ \" | grep -v \"< @@ \" | grep -v \"^---$\" '"
result = `#{cmd}`.chomp
unless "" == result
puts "\n\n#{pair[0]}: ---------------------"
puts
puts result
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment