Skip to content

Instantly share code, notes, and snippets.

@BenWhitehead
Created March 25, 2014 16:36
Show Gist options
  • Save BenWhitehead/9765835 to your computer and use it in GitHub Desktop.
Save BenWhitehead/9765835 to your computer and use it in GitHub Desktop.
A shell pipeline to get only the modified lines from a patch (useful to count actual number of lines changed in a patch)
# select lines that begin with + or -, remove lines that start with +++, remove lines that start with ---
grep "^[+-]" full.patch | grep -v "^+++" | grep -v "^---" > trim.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment