1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-20 10:53:23 -07:00

add countdiff util for counting lines that differ

This commit is contained in:
Connor Olding 2019-06-05 12:38:12 -07:00
parent b89ac3c39d
commit dd72962588

6
sh/countdiff Normal file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env sh
countdiff() {
git --no-pager diff --stat --no-color --no-index "$1" "$2" \
| awk '/changed/{print $4+$6;a=1}END{if(!a)print 0}'
}
countdiff "$@"