cloc diff does'nt count same or modified
Brought to you by:
alnd
cloc-1.60 increments the added/removed values instead of the same or modified values in some cases.
When I run:
C:\Test>cloc-1.60.exe --diff .\temp\1\ .\temp\4\ --skip-uniqueness
then I get:
...
SUM:
same 0 0 0 0
modified 0 0 0 0
added 1 0 0 1
removed 3 0 0 3
The directory 1 and 4 contains a pair of same files but "same" is 0.
Anonymous
Thanks for the report, and especially for the zip file--makes life much easier for me.
The issue is this: temp/4 has just a single file and this throws a monkey wrench into the current logic which attempts to do a pair-wise alignment of files in the left set (temp/1) and the right set (temp/4). As soon as you add a second file to temp/4, the same count will go to 1.
I'll work on this corner case of 1:N diff for the next release.
I was wondering what the status was of this issue
Believe me, I have not forgotten. This bug (and related #107) has been the millstone around my neck whose clean solution keeps slipping away from me. It is the one issue that has kept me from making the next release. All I can tell you is that I'm still on it.
svn commit 391 fixes this problem. Please try it out (using https://sourceforge.net/p/cloc/code/HEAD/tree/trunk/cloc) if you can.
v1.62 released
still have the problem
please post a zip file with inputs that demonstrate the problem (using cloc v1.62)
I've already submitted a bug:
http://sourceforge.net/p/cloc/bugs/121/
I also face similar issue. Results for same set of files are not comparable for version 1.58 and 1.62. I also see same problem that is don't see "same" and "modified" data with --diff option.
Is there any workaround for this issue till new release?
The diff logic changed between 1.58 and 1.62. In most cases the new logic gives more correct results. It is always possible for a diff to fail if there is not enough similarity between two sets. For starters, post a zip or tar file demonstrating the issue you're facing.