Skip to content

"Blame" does not give me all changed lines #520

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

Closed
dimitris93 opened this issue Sep 25, 2016 · 0 comments
Closed

"Blame" does not give me all changed lines #520

dimitris93 opened this issue Sep 25, 2016 · 0 comments

Comments

@dimitris93
Copy link

Below I print the total number of lines changed in a specific commit: f092795fe94ba727f7368b63d8eb1ecd39749fc4:

from git import Repo

repo = Repo("C:/Users/shiro/Desktop/lucene-solr/")

sum_lines = 0
for blame_commit, lines_list in repo.blame('HEAD', 'lucene/core/src/java/org/apache/lucene/analysis/Analyzer.java'):
    if blame_commit.hexsha == 'f092795fe94ba727f7368b63d8eb1ecd39749fc4':
        sum_lines += len(lines_list)
print sum_lines

The output is 38. However, if you simply go to apache/lucene-solr@f092795 and look at the commit yourself for file /lucene/analysis/Analyzer.java, the actual number of lines changed is not 38 but it is 47. Some lines are completely missing.

Why am I getting a wrong value ?

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

No branches or pull requests

1 participant