Count Code Lines

344 views
Skip to first unread message

Tuna Bozkır

unread,
Mar 24, 2021, 6:58:35 AM3/24/21
to git-for-windows
Hello , I want to count all code lines seperately by every developers. How can I do that with git ? Thank you very much.

Johannes Schindelin

unread,
Mar 25, 2021, 7:51:42 AM3/25/21
to Tuna Bozkır, git-for-windows
Hi Tuna,

On Wed, 24 Mar 2021, Tuna Bozkır wrote:

> Hello , I want to count all code lines seperately by every developers. How
> can I do that with git ? Thank you very much.

This is somewhat underspecified (do you mean the _current_ revision's
lines, or do you mean the lines added/removed in the entire commit
history?), and it is not specific to Windows, so it is better discussed on
the Git mailing list.

Having said that, a quick web search has a couple interesting hits, e.g.

- https://gist.github.com/amitchhajer/4461043

git ls-files |
xargs -n1 git blame --line-porcelain |
sed -n 's/^author //p' |
sort -f |
uniq -ic |
sort -nr

- https://stackoverflow.com/questions/42715785/git-show-statistics-for-authors-contributions

- https://github.com/victorx64/devrating

But there are also a couple of cautious words, e.g.
https://www.gitclear.com/count_lines_of_code_but_dont_be_naive

Ciao,
Johannes

Tuna Bozkır

unread,
Mar 25, 2021, 8:40:27 AM3/25/21
to Johannes Schindelin, git-for-windows
Thanks, I'll check them out.
Reply all
Reply to author
Forward
0 new messages