I am trying to find the total number of lines added and the total number of lines deleted by the user in the git repository. I looked. How to count the common lines changed by a specific author in a git repository? , which had the command git log --author="<authorname>" --pretty=tformat: --numstat , but the script could not give the answer (albeit simple) to reduce the number of lines. What is the easiest way to sum up lines added / deleted?
git log --author="<authorname>" --pretty=tformat: --numstat
$ git log --author="<authorname>" --pretty=tformat: --numstat | perl -ane' > $i += $F[0]; $d += $F[1]; END{ print "added: $i removed: $d\n"}'
Also runs with awk:
git log --author="<authorname>" --pretty=tformat: --numstat | awk -F" " '{ added += $1; removed += $2 } END { print "added: ", added, "removed:", removed }'
Source: https://habr.com/ru/post/1309227/More articles:Explicit C # interface interface implementation for interfaces that inherit from other interfaces - explicitHow to get the full path to an arbitrary ruby class? - ruby | fooobar.comHow can I securely sign requests for Last.fm api? - c #CRM Architecture (Open Source Application) - asp.netMySQL, Coldfusion, selecting records marked in the last 24 hours - coldfusionRun Javascript in the body of a Gmail message - mathJavaScript: Given the offset and length of the substring in the HTML string, what is the parent node? - javascriptIterating over two arrays at a time in javascript - javascriptImplementation of the ceil function in C - cC # Implicit array declaration - arraysAll Articles