-
Notifications
You must be signed in to change notification settings - Fork 899
Upgrade binaries to current LibGit2 HEAD. (5d91bea) #722
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
Conversation
The default config getter needs to grab the snapshot version. |
Perfect, I'll do that, thanks. |
@carlosmn So, instead of getter being 'config.Value', you mean adding a config_snapshot call before-hand, right? |
Oh, I understood what you meant now. |
@nulltoken Any insight on the unit tests that are failing? Also on the MergePreference approach. |
@@ -88,7 +88,7 @@ public Configuration(string globalConfigurationFileLocation = null, string xdgCo | |||
/// </summary> | |||
public virtual bool HasConfig(ConfigurationLevel level) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure whether this would require a snapshot or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should favour using a snapshot unless we need to write into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Update on failing tests: The RetrieveStatus function apparently has lots of +0/-0, which either means lineendings changed or filemodes, but I don't see them changed either. I'm currently at a loss and I'd like someone to give some insight over this. |
@@ -72,6 +72,28 @@ internal enum GitMergeAnalysis | |||
} | |||
|
|||
[Flags] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need the Flags
attribute - I think these are all exclusive values, even if the C representation treats these as combinable values...
/cc @ethomson ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than not being able to safely use them in a switch, what could be the issue here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel marking an enum as flag when the enum is not a flag will be confusing to people who work with this. We can do direct comparisons on the value, instead of seeing using the HasFlag(..)
method to see if a value contains a flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(off-topic: HasFlag is slower than (x & flag) != 0)
I think there are a couple of ways this could be done. My initial thoughts would be to move Either way, I would suggest doing the changes for the |
@jamill Obviously, the same way I handled Configuration changes. I'm only rebasing where necessary so I keep commits atomic. |
Removed the Flags attribute as per @jamill 's request. Also added a commit in which we keep track of MergePreference (it's still unused, all I know about it is that it's the value of the user's config for merge.ff and I don't know how that changes a call to Merge.) |
It doesn't change the call to Merge, just like the analysis of the possibilities doesn't. It lets the tool writer know what the user preference is so it can decide whether to call Merge or not. |
@Therzok I've started to look at the failing tests.
Below the output of
Following patch makes it pass: diff --git a/LibGit2Sharp.Tests/CleanFixture.cs b/LibGit2Sharp.Tests/CleanFixture.cs
index 9613a2c..8ca9972 100644
--- a/LibGit2Sharp.Tests/CleanFixture.cs
+++ b/LibGit2Sharp.Tests/CleanFixture.cs
@@ -13,14 +13,16 @@ public void CanCleanWorkingDirectory()
using (var repo = new Repository(path))
{
// Verify that there are the expected number of entries and untracked files
- Assert.Equal(6, repo.Index.RetrieveStatus().Count());
- Assert.Equal(1, repo.Index.RetrieveStatus().Untracked.Count());
+ var status = repo.Index.RetrieveStatus();
+ Assert.Equal(10, status.Count());
+ Assert.Equal(1, status.Untracked.Count());
repo.RemoveUntrackedFiles();
// Verify that there are the expected number of entries and 0 untracked files
- Assert.Equal(5, repo.Index.RetrieveStatus().Count());
- Assert.Equal(0, repo.Index.RetrieveStatus().Untracked.Count());
+ var newStatus = repo.Index.RetrieveStatus();
+ Assert.Equal(9, newStatus.Count());
+ Assert.Equal(0, newStatus.Untracked.Count());
}
} |
@Therzok Hmmm. Hold on to the previous comment. I need to dig a little deeper. |
@nulltoken there are 44 tests failing, and I don't know what changed. It's the index behaving differently. |
Actually, I think this is because libgit2 has been tuned to behave more like git.git. (Kudos to @arrbee!). #727 updates the test repo so that they're no longer expose a dirty status. Before I merge it, could you please give a try and rebase your PR on top of it. My local tests show that it fixes most of the issues. |
Sure thing! Will do that in a jiffy. |
Yes, all tests pass now, thanks @nulltoken . Merge your PR, then this build can be redone. |
Wait, one still failed. LibGit2Sharp.Tests.StatusFixture.RetrievingTheStatusOfTheRepositoryHonorsTheGitIgnoreDirectivesThroughoutDirectories. |
I've seen this as well. @carlosmn is trying to reproduce this through a libgit2 unit test. |
It's currently being run through TeamCity CI server (http://teamcity.codebetter.com/project.html?projectId=LibGit2Sharp). Will be merged shortly after. |
|
I'll rebase on top of master and repush. |
Done. |
So, do I wait for a fix in libgit2 and amend e869a8e? |
The fix is in two parts, I'm going to send PRs for them. |
Updated to new tip of libgit2 and cherry-picked @carlosmn 's fix. This should be good to go. |
All the outstanding fixes have been applied and the commits have been squashed. When it goes green, I think this can be merged. |
@Therzok Amazing work! Thanks: ✨ ✨ ✨ ✨ ✨ |
Okay so this is the bump itself. I split it into binary update then API usage update.
A few things which I will handle later on: