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

Walker sometimes fails to hide commits #431

Closed
pkill opened this issue Nov 11, 2014 · 9 comments
Closed

Walker sometimes fails to hide commits #431

pkill opened this issue Nov 11, 2014 · 9 comments

Comments

@pkill
Copy link

pkill commented Nov 11, 2014

Background

I recently upgraded GitLab from v7.3 to v7.4. One of the big changes in GitLab supplants Grit with Rugged to compute comparisons between commit objects. I'm noticing undesired behavior with computing comparisons: In some, but not all cases, the comparison returns the entire history of the branch rather than the difference between two branches. There is an active GitLab bug report that expresses others frustrations with this issue: https://github.com/gitlabhq/gitlabhq/issues/8174

This bug is causing a variety of downstream problems the administration of a GitLab v7.4 instance.

Verification

I fired up irb to isolate various Rugged versions and reproduce the behavior. Unfortunately I cannot furnish the repository used here for reproduction. As you can see, Rugged 0.19 produces the correct number of commits between those to objects but Rugged 0.21 is not properly hiding the rest of the commits and returning everything.

Just glancing at the code, it appears that the walker is not properly hiding the rest of the commits.

Rugged 0.19

2.1.2 :005 > w = Rugged::Walker.new(Rugged::Repository.new('/home/git/repositories/repo/repo-tools.git'));w.push('db6e3023debc1d6af9a73373492db11a6849b6ec');w.hide('bd30827036271ada67cb303373dfe7889490382d');w.to_a.size
 => 15 

Rugged 0.21

2.1.2 :001 > w = Rugged::Walker.new(Rugged::Repository.new('/home/git/repositories/repo/repo-tools.git'));w.push('db6e3023debc1d6af9a73373492db11a6849b6ec');w.hide('bd30827036271ada67cb303373dfe7889490382d');w.to_a.size
 => 2223 

Here is my environment details:

$ uname -a
Linux server 2.6.32-431.11.2.el6.x86_64 #1 SMP Tue Mar 25 19:59:55 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ ruby --version
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
@arthurschreiber
Copy link
Member

Have you tried the same thing with the latest version of Rugged from git?

@pkill
Copy link
Author

pkill commented Nov 11, 2014

Is there a gem already released for a newer version?

@arthurschreiber
Copy link
Member

You could try 0.21.1b2 (a beta gem).

@pkill
Copy link
Author

pkill commented Nov 11, 2014

0.21.1b2 looks to have solved the regression. Do you recommend 0.21.1b instead?

@pkill
Copy link
Author

pkill commented Nov 11, 2014

@arthurschreiber was this a problem with Rugged or libgit2?

@arthurschreiber
Copy link
Member

This is a problem with libgit 0.21.0. In general, 0.21.1b2 should be fine, but it might include breaking API changes, so YMMV.

@gregbuehler
Copy link

@arthurschreiber Can you speak in general terms as to the timeline for a 0.21.1 release (Days, Weeks, Months)?

@arthurschreiber
Copy link
Member

Except for potential API changes, 0.21.1b2 should be as "stable" as it gets. I think that's also what Github has been using in production since October.

Also, the 0.21.1b2 name is a bit of a lie, as the bundled libgit2 version is not API compatible with libgit2 0.21.1, but is instead based on some commit off the libgit2 master branch.

@vmg I'm not sure what to do here. I'd like to release a 0.21.2 version of Rugged, based on the libgit2 0.21.2 release, but it won't be compatible with the hashsig changes in rugged 0.21.1b2. Is that a problem?

@arthurschreiber
Copy link
Member

Hey folks,

I just release 0.21.2, which comes bundled with libgit 0.21.2 and should fix the issue you're seeing with the walker. Let me know if you run into any issues with that release.

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

3 participants