By combining the power of git and bash, we can have in an instant an estimation of lines number in a project.
For instance to count lines number in versionned perl files:
$ git ls-files | egrep ".*(driver|core).*pl$" | xargs wc -l
git ls-files
will only return files versionned which is a first interesting filter.egrep pattern
will allow us to filter precisely a portion of project (by file extension, path, etc.)wc -l
will count lines by file and make the sum.
Found here : http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
Warning, do not use
grep -e
which accepts only one pattern per-e
.egrep
is more useful.
Generate that kind of output :
$ git ls-files | egrep ".*(driver|core).*pl$" | xargs wc -l
1090 cgi-bin/coreOVECC.pl
2460 cgi-bin/driver.pl
3550 total
3550 lines of code in two files, what a pleasure :(