Skip to content

Fix missing parents #19

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

Merged
merged 6 commits into from
Mar 31, 2017
Merged

Fix missing parents #19

merged 6 commits into from
Mar 31, 2017

Conversation

tiennou
Copy link
Contributor

@tiennou tiennou commented Jan 15, 2017

This reverts a change I did recently w.r.t to how we enumerate commits.

This should make the "broken" lane bug go away, at the expense of more lanes in some cases. As for the underlying issue, I don't really know why this happens. I suspect libgit2 doesn't revwalk in the same way as Git does, but I don't really have time to check what really differs...

GTCommit *branchCommit1 = obj1;
GTCommit *branchCommit2 = obj2;

return [branchCommit1.commitDate compare:branchCommit2.commitDate];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to admit I do not understand the surrounding code and what sort it tries to achieve … but this seems to revert the sort order.

WIth the preceding commits and reverts changing this behaviour, I am a bit confused, so perhaps an explanation would be good.

(As it’s unclear to me from which direction the resulting list will be traversed, I cannot figure out whether newest first or oldest first would be the correct way to go here.)

@tiennou
Copy link
Contributor Author

tiennou commented Jan 30, 2017

Just so I'm clear, this is a tentative fix. I'm currently trying to pinpoint a reproduction testcase so I can concentrate on looking at bad graphs instead of hoping that the issue show up.

At the moment, I think #17 happens when you have a branch (B) based on another branch (A), and you rebase (maybe with fixups?) all of them against your current master. You'll have commits from B that are older than the current commit from A and the graph code will be confused.

But I've seen another really weird issue while running that one too, so I'm not sure anymore if the fix is correct.

@ssp
Copy link
Contributor

ssp commented Jan 31, 2017

@tiennou : By all means, give it a shot!

I am seeing this issue regularly (working around it by reloading). In case that helps for your theories: my typical workflow includes doing git pull --rebase and I tend to see the issue after doing that.

gitx chaoslanes2

Let me know if doing any particular tests would be helpful.

@tiennou
Copy link
Contributor Author

tiennou commented Jan 31, 2017

If you can make it go away by reloading, I think it's not this issue (it's another one I'm aware of though 😉).

The underlying problem is that :

  • when time-sorting (currently), rebased commits can have a parent that's more recent than them, which causes the graphing code to draw a never-ending line because the parent commit was already visited.
  • when topo-sorting (this PR), sometime the top branches are not what you expect, so your "work zone" is like, in the middle of the commit history. Which is counter-intuitive. I'm not actually up to speed w.r.t what topo vs. time means (apart from the obvious), so that was mostly a shot in the dark.

For the record, the initial switch git revwalk is in 52e00f8#diff-5e61c11d85ff9177af2191825cd7e884L181, which was a topo-sort.

@tiennou tiennou force-pushed the fix/missing-parents branch from 236db8b to d6d5d06 Compare March 14, 2017 23:22
@tiennou
Copy link
Contributor Author

tiennou commented Mar 14, 2017

I think I got it. It was waaaay easier than I thought 😆. I'll be running that along with a bunch of other branch, so I'll see if it really went away.

@ssp Thinking about it, this is what I saw just before ASan triggered (the report I posted came from that). I'm not sure what happens though (apart from ASan being unhappy), I'd suspect we have a bunch of objects pointing to old OIDs that get graphed at the same time as the new ones, but a refresh removes the old ones. Do you have the "auto-refresh" thingy enabled ?

@ssp
Copy link
Contributor

ssp commented Mar 16, 2017

@tiennou looking forward to it! I seem to have run into this issue more often recently.

tiennou added 6 commits March 31, 2017 12:02
While investigating gitx#17, I found that code pretty hard to understand.

For the record, it built a set of OIDs while extracting the meaning of the `PBGitRevSpecifier`, which (since sets have no order) I suspected could cause the out-of-order behavior we had. Turns out the fix was much easier, but since I find this one cleaner, and less "loopy", here it is.
@tiennou tiennou force-pushed the fix/missing-parents branch from d6d5d06 to 4bc3720 Compare March 31, 2017 10:02
@tiennou tiennou merged commit 8f66be5 into gitx:master Mar 31, 2017
@tiennou tiennou deleted the fix/missing-parents branch March 31, 2017 10:16
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

Successfully merging this pull request may close these issues.

2 participants