3 ms·
Here is a sample implementation: git log --author=rav --numstat --no-merges --pretty=format: | awk -e '{ a += $1; b += $2; } END { print a; print b
by rav 13y ago
Here is a sample implementation:
git log --author=rav --numstat --no-merges --pretty=format: |
awk -e '{ a += $1; b += $2; } END { print a; print b; print a-b; }'
produces this output (sum additions, sum deletions, net line additions):
112529
85383
27146
- zwegner 13y agoHa, nice, there's two options that definitely would've simplified my code (--numstat and --no-merges).
- porges 13y agoTo count by author: git log --numstat --no-merges --pretty=format:%an | awk ' author == "" { author = $0; next } /^$/ { author = ""; next } { added[author] += $1; removed[author] += $2 } END { for (author in added) { print author, "added", added[author], "removed", removed[author], "sum", added[author]-removed[author] } }' | sort -n -k 7
- taybin 13y agoThat is great! Thank you.