查询最近三个月每个开发人员代码行数
git log --since="3 months ago" --pretty='%aN' | sort | uniq | while read author; do
git log --author="$author" --since="3 months ago" --pretty=tformat: --numstat | \
awk -v author="$author" '{ add += $1; subs += $2; loc += $1 + $2 } END \
{ printf "作者: %s, 添加的行数: %s, 删除的行数: %s, 总代码行数: %s\n", author, add, subs, loc }' -
done
结果如下