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

The result of diff is different from the result of git diff #765

Closed
yikengboy opened this issue Sep 11, 2023 · 6 comments
Closed

The result of diff is different from the result of git diff #765

yikengboy opened this issue Sep 11, 2023 · 6 comments

Comments

@yikengboy
Copy link

yikengboy commented Sep 11, 2023

Describe the bug
Comparing the two commitIds with git diff and cloc --git-diff-rel respectively, the results seem to be completely different.

**cloc; OS; Centos

  • cloc version: lastest
  • OS version: Linux

To Reproduce
git diff --shortstat ff2a43717e7f9d2d3966b155912c0c4b9b3009da 18d4f379a1424c4a23995b6e1cf9a1f939b10379
image

cloc --git-diff-rel ff2a43717e7f9d2d3966b155912c0c4b9b3009da 18d4f379a1424c4a23995b6e1cf9a1f939b10379
image

@AlDanial
Copy link
Owner

Point me to the repo with these commits. Or, if that's not practical, find a common repo we can both access which demonstrates the problem you have in mind.

@yikengboy
Copy link
Author

Okay, I'll get a common repo when I have time, thanks for your answer

@yikengboy
Copy link
Author

Well ! I know it. Because I change file-name in one commit, git diff can discern this change.
however, cloc --git-diff-rel will generated two records of increase and decrease!
How can I identify this situation?

@AlDanial
Copy link
Owner

git returns a "similarity index" on with diff --find-renames which can identify this situation. I even have a place-holder option in cloc, currently commented out, called --git-diff-simindex to support this capability but I have not implemented it yet. It is tricky.

@yikengboy
Copy link
Author

all right, is this feature possible?

@AlDanial
Copy link
Owner

It is possible, but as to when, I can't say. The cleanest thing to do will be close this issue then create a new one specifically requesting this feature, ie, "implement --git-diff-simindex". You're welcome to do that and it will keep my mind on it.

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