[READ-ONLY] Mirror of https://github.com/mrgnw/scripts.
1#!/bin/zsh
2git log --format="" --numstat | awk 'BEGIN {
3 printf "\033[1m%4s\t%-4s\t%s\033[0m\n", "+", "-", "File"
4} {
5 add[$3] += $1;
6 del[$3] += $2;
7} END {
8 for (f in add) {
9 printf "%s\t%4d\t%-4d\n", f, add[f], del[f]
10 }
11}' | sort | awk 'BEGIN {
12 printf "\033[1m%4s\t%-4s\t%s\033[0m\n", "+", "-", "File"
13} {
14 if (NR > 1) {
15 printf "\033[32m%4d\033[0m\t\033[31m%-4d\033[0m\t%s\n", $2, $3, $1
16 }
17}'