标签:printf print log -o read lines pre int com
git log --author="your_name_here" --pretty=tformat: --numstat | awk ‘{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }‘
结果示例:
added lines: 132986, removed lines: 1095369, total lines: -962383
git log --format=‘%aN‘ | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --numstat | awk ‘{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }‘ -; done
标签:printf print log -o read lines pre int com
原文地址:http://www.cnblogs.com/jlove/p/6931384.html