How to determine the number of lines of code in each file after each commit in a git repo

118 views Asked by At

I need to determine the number of lines in each file after each commit of a git repo. How do I do this?

I've looked at gitstats and git-loc, but both seem to calculate aggregate statistics, and I'm not sure how to adapt their code to my needs.

1

There are 1 answers

0
Brian M On

How about adding a post-commit hook that does this? It could look something like:

for f in `git ls-files`; do; wc -l $f; done;

where "wc -l" could be replaced with your preferred SLOC counter.