3

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.

Matt Fenwick
  • 48,199
  • 22
  • 128
  • 192
  • Related, but doesn't ask for stats for individual files: http://stackoverflow.com/questions/23907/how-can-i-graph-the-lines-of-code-history-for-git-repo – Matt Fenwick Aug 02 '12 at 13:44

1 Answers1

0

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.

Brian M
  • 85
  • 5