[p4] Anyone have something that tells the number of lines of code in perforce?

Gareth Rees gdr at ravenbrook.com
Wed Dec 12 03:44:42 PST 2001

At 15:24 -0800 2001-12-11, Rita Ozanne wrote:
>Has anyone had to generate a report on the number of lines of code 
>that is in a perforce tree?

I've never had to do it, but if I did I would run a command like this:

p4 files ... | grep -v "delete change" | cut -d '#' -f 1 | egrep 
'\.(c|h|cpp|lisp|pl|py)$' | xargs p4 where | cut -d ' ' -f 3 | xargs 
wc -l

More information about the perforce-user mailing list