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

132 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 best solutions below

0
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.