Skip to content

Instantly share code, notes, and snippets.

@evansolomon
Created August 23, 2012 18:43
Show Gist options
  • Save evansolomon/3440120 to your computer and use it in GitHub Desktop.
Save evansolomon/3440120 to your computer and use it in GitHub Desktop.
Measure the added and deleted lines in patches
# For patches, lower numbers are better
function redgreen() {
ack "^[-|\+]" -oh | sort | uniq -c | ack [0-9]+ -oh | xargs | awk '{print $1 - $2}'
}
# Example usage
# $ svn di | redgreen
# $ -150
@nb
Copy link

nb commented Aug 24, 2012

Just curious, why do you need this?

Also, if you haven't looked at diffstat it's pretty cool.

@aaroncampbell
Copy link

A modified version that ignores the --- and +++ lines and prints added, remove, and total difference: https://gist.github.com/4666039

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment