Skip to content

Instantly share code, notes, and snippets.

@jugyo
Created February 4, 2009 04:55
Show Gist options
  • Save jugyo/57943 to your computer and use it in GitHub Desktop.
Save jugyo/57943 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
`svn diff #{ARGV.join(' ')}`.each do |line|
puts( if line =~ /^\+(.*)$/
"\e[32m#{$&}\e[0m"
elsif line =~ /^-(.*)$/
"\e[31m#{$&}\e[0m"
else
line
end
)
end
# see also http://www.pjhyett.com/posts/203-colored-svn-diff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment