diffstat - randomcrap - random crap programs of varying quality
(HTM) git clone git://git.codemadness.org/randomcrap
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
diffstat (313B)
---
1 #!/bin/sh
2 # script to quickly check how much is changed in a patch.
3
4 LC_ALL=C awk '
5 $0 ~ /^(\+\+\+|\-\-\-) /{
6 # likely a diff header for a file.
7 next;
8 }
9 length($0) {
10 c = substr($0, 1, 1);
11 if (c == "-")
12 del++;
13 else if (c == "+")
14 add++;
15 }
16 END {
17 printf("%d insertions(+), %d deletions(-)\n", add, del);
18 }'