Skip to content

Instantly share code, notes, and snippets.

@anantpatil
Created January 31, 2013 08:46
Show Gist options
  • Save anantpatil/4681397 to your computer and use it in GitHub Desktop.
Save anantpatil/4681397 to your computer and use it in GitHub Desktop.
Colored svn diff command. When using a "svn diff", its easy to see the differences based on color instead of based on + or - symbol in the beginning of the line. Usage: $svndiff <file name>
#!/bin/sh
# Output colored text
# Color the contents of working copy green and old copy red.
svn diff $* | sed -e 's/^+/\x1b\[32m+/;s/^-/\x1b[31m-/;s/$/\x1b[0m/';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment