Skip to content

Incorrect Diff object contents #194

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
jatinganhotra opened this issue Nov 26, 2014 · 2 comments
Closed

Incorrect Diff object contents #194

jatinganhotra opened this issue Nov 26, 2014 · 2 comments

Comments

@jatinganhotra
Copy link

Hi,

When I run the following steps on the project - Github - LightTable
I noticed that the number of entries for Difffiles in Diff object is different than the number of entries in the stats[:total] for the Diff object.

$rubygit_gem_repo = Git.open(git_repo_path, :log => Logger.new(STDOUT))
commit_list = $rubygit_gem_repo.log(nil)
commit_list_array = commit_list.to_a
commit_list_array.reverse!
prev_commit = commit_list_array[8]
next_commit = commit_list_array[9]
prev_sha = prev_commit.sha
 => "2c9b866d8fd6ed45fb896ed2f9c8edf6e38f6069"
next_sha = next_commit.sha
 => "ce8a4f0a910f58acaaf4f8c8a964afdf03f16d37"
diff = diff_bw_commits.to_a
puts diff.size
 => 137
puts diff_bw_commits.stats[:total]
 => {:insertions=>11317, :deletions=>1245, :lines=>12562, :files=>134}

I went further to find the inconsistency and found that the file names are incorrect in both cases - i.e. in the stats object and the Difffile objects.
I've attached the file names in the following Gist - https://gist.github.com/silverSpoon/3aeb985e56b37583c08a

The exact problem is also present in other open-source projects too, such as
https://github.com/basho/riak.git
https://github.com/thinkaurelius/titan.git
https://github.com/atom/atom.git

I can pin-point the exact commits for these projects too, if that helps.

@jatinganhotra
Copy link
Author

If you are short on time, may be you could share some analysis on how to fix this bug and I'll dig deeper into it.

@stale
Copy link

stale bot commented Apr 2, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 2, 2018
@stale stale bot closed this as completed Apr 9, 2018
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