GIT command line statistics the number of lines of code submitted

Project encountered when writing the report feedback to a person or a function of the amount of code, and no integrated CI these plug-ins, you can simply count down code with the GIT command Filers:

- Statistical someone commit code

git log --author = --pretty = tformat "oldwang": --numstat | gawk '{add + = $ 1; subs + = $ 2; loc + = $ 1 - $ 2} END {printf "increasing the number of rows:% s the number of rows deleted:% s number of rows:% s \ n ", add, subs, loc} '

- Submit the code time someone range of statistics

git log --author = "oldwang" --since = '2019-04-01' --until = '2019-04-07' --pretty = tformat: --numstat | gawk '{add + = $ 1; subs + = $ 2; loc + = $ 1 - $ 2} END {printf "increasing the number of rows: number of rows deleted% s:% s number of rows:% s \ n", add, subs, loc} '

- Statistical everyone deletions rows

git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: 

Guess you like

Origin www.cnblogs.com/angryjj/p/11392053.html