Counting changed lines of code over time

前端 未结 3 900
长情又很酷
长情又很酷 2021-02-01 02:24

Is there any good tool that computes the number of changed lines of code over a certain time period in a mercurial repository? Something along the lines of statsvn would be grea

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-01 03:05

    I needed to do this, and spent quite a bit of time with the hg churn extension and similar solutions.

    In the end, I found that what worked best for me was CLOC (Count Lines of Code): http://cloc.sourceforge.net/

    You can give it two folders containing two versions of a project, and it will count all of the lines that are the same, modified, added, removed. It recognises multiple languages and itemises code, comments and blank lines.

    To use it, I pulled out the two versions of my code from Hg into two parallel folders, and then used cloc --diff --ignore-whitespace

提交回复
热议问题