AlDanial / cloc

cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.
GNU General Public License v2.0
19.75k stars 1.02k forks source link

"cloc --git-diff-rel --csv --by-file refs/tags/first-tag refs/tags/second-tag" returns a wrong number of records #864

Open EnricoPicci opened 4 weeks ago

EnricoPicci commented 4 weeks ago

Describe the bug The command "cloc --git-diff-rel --csv --by-file refs/tags/first-tag refs/tags/second-tag" returns 3 record but the difference between "first-tag" and "second-tag" is only of 2 records.

cloc; OS; OS version

To Reproduce

Expected result "cloc --git-diff-rel --csv --by-file refs/tags/first-tag refs/tags/second-tag" should return 2 records and the right number of lines changed, added, removed

Additional context Add any other context about the problem here.

AlDanial commented 3 weeks ago

I can duplicate the problem. May be a couple of weeks for a fix.

AlDanial commented 3 weeks ago

Please give 62b9c4b a try. This uses smarter logic based on git itself to align file names (and identify file renames, a long overdue issue). If it works for you I'll add new test cases before closing.