|
|
diffstat - various - Various utilities developed at bitreich. |
|
|
 |
git clone git://bitreich.org/various/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/various/ (git://bitreich.org) |
|
|
 |
Log |
|
|
 |
Files |
|
|
 |
Refs |
|
|
 |
Tags |
|
|
|
--- |
|
|
|
diffstat (358B) |
|
|
|
--- |
|
|
|
1 #!/bin/sh |
|
|
|
2 # script to quickly check how much is changed in a patch. |
|
|
|
3 # Written and (c) by Evil_Bob on 2022-01-10. |
|
|
|
4 |
|
|
|
5 LC_ALL=C awk ' |
|
|
|
6 $0 ~ /^(\+\+\+|\-\-\-) /{ |
|
|
|
7 # likely a diff header for a file. |
|
|
|
8 next; |
|
|
|
9 } |
|
|
|
10 length($0) { |
|
|
|
11 c = substr($0, 1, 1); |
|
|
|
12 if (c == "-") |
|
|
|
13 del++; |
|
|
|
14 else if (c == "+") |
|
|
|
15 add++; |
|
|
|
16 } |
|
|
|
17 END { |
|
|
|
18 printf("%d insertions(+), %d deletions(-)\n", add, del); |
|
|
|
19 }' |
|