对当前分支,统计'2018-08-25'~'2018-12-31'时间内的代码量命令:
git log --since='2018-08-25' --until='2018-12-31' --format='%aN' | sort -u | while read name; do echo -en "$name,"; git log --since='2018-08-25' --until='2018-12-31' --author="$name" --numstat --pretty=tformat: --no-merges | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines, %s, removed lines, %s, total lines, %s\n", add, subs, loc }' -; done >> XXX_18_12_31_code.csv;
git log --since='2018-08-25' --until='2018-12-31' --format='%aN' | sort -u | while read name; do echo -en "$name,"; git log --since='2018-08-25' --until='2018-12-31' --author="$name" --numstat --pretty=tformat: --no-merges | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines, %s, removed lines, %s, total lines, %s\n", add, subs, loc }' -; done >> XXX_18_12_31_code.csv;
如果直接复制上面命令可能会因为字符的原因报错,所以我百度云上放了一份,大家可自行下载文本
链接:https://pan.baidu.com/s/1-g9kQgvmNitUDcyoQmK9Zw
提取码:o2t7
微信扫描下方二维码(新开通的个人微信公众号) 更多优质资源及优质文章及时获取 请大家多多支持哦