-1

How can I count the number of words that each contributor wrote in a repository ?

harpun
  • 4,022
  • 1
  • 36
  • 40
WebCoder
  • 9
  • 3

1 Answers1

0

It is best solved on a local clone of that GitHub, in order to analyze the git log and check each contributor.

See "getting contributor stats", based on:

git log --author="Jared Barboza" --pretty=tformat: --numstat | \
grep -v public/javascripts/jquery | \
gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END \
{ printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }' -

But that is for lines added/removed for a given contributor.

(a bit like in "Git: How to estimate a contribution of a person to my project in terms of added/changed lines of code?")

You can combined a similar approach with the one described in "Quantifying the amount of change in a git diff?".
Or you can use a dedicated program for that, like git-wordcount.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250