Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"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 this issue Oct 29, 2024 · 2 comments

Comments

@EnricoPicci
Copy link

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

  • cloc version: 2.0
  • If running the cloc source, Perl version:
  • OS (eg Linux, Windows, macOS, etc): Ubuntu
  • OS version: 22.04.3 LTS

To Reproduce

  • Clone the repo https://github.com/EnricoPicci/gitlab-tools.git
  • Run the command "cloc --git-diff-rel --csv --by-file refs/tags/first-tag refs/tags/second-tag" -> this returns 3 records (2 records actually refer to the same file README.md)
  • Run the command "git diff refs/tags/first-tag refs/tags/second-tag --name-only" and this returns 2 files
  • Moreover the number of lines changed, deleted, added returned by "cloc --git-diff-rel" is wrong

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
Copy link
Owner

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

@AlDanial
Copy link
Owner

AlDanial commented Nov 2, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants