X-Git-Url: https://git.jacobcasper.com/?p=blame.git;a=blobdiff_plain;f=blame.sh;h=93d73752ebb71dd00c3697cc722a263d8498a6f6;hp=6c32e2eab89816021433857b72b0be12d56c8c9b;hb=HEAD;hpb=7401f582b6a086c168151825b4e06d9e747d8f1d diff --git a/blame.sh b/blame.sh index 6c32e2e..93d7375 100755 --- a/blame.sh +++ b/blame.sh @@ -1,2 +1,5 @@ #!/bin/sh -git blame --line-porcelain -- $1 | awk '/^author /' | awk '{$1 = ""; author=substr($0, 2); counts[author] += 1} END { for (author in counts) {print counts[author],author,counts[author],counts[author]/NR*100"%"} }' | sort -nr -k 1 | awk '{$1 = ""; print $0}' +for FILE in "$@"; do + echo $FILE + git blame --line-porcelain -- $FILE | awk '/^author /' | awk '{$1 = ""; author=substr($0, 2); counts[author] += 1} END { for (author in counts) {print counts[author],author,counts[author],counts[author]/NR*100"%"} }' | sort -nr -k 1 | awk '{$1 = ""; print $0}' +done