-
Notifications
You must be signed in to change notification settings - Fork 899
Upgrade to latest libgit2 #1124
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
This has to be locally run against the NuGet package that can be downloaded here |
The fixup commit fixes some borked tests. @Therzok can you please review the changes? |
Remaining failing tests are submodule related
@dahlbyk Any chance you could peek at those and determine if our previous expectations were sound or not? Would it be some regression at the libgit2 level or some over-engineered testing at our level? |
@@ -19,5 +19,10 @@ public enum StashApplyStatus | |||
/// The stash index given was not found. | |||
/// </summary> | |||
NotFound, | |||
|
|||
/// <summary> | |||
/// The stash index given was not found. |
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.
Duh
It looks like @carlosmn thinks it might be a regression as git.git seems to not choke on trailing path separators. |
@@ -1,6 +1,6 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.55\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.55\build\LibGit2Sharp.NativeBinaries.props')" /> | |||
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.60-pre20150627175731\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.60-pre20150627175731\build\LibGit2Sharp.NativeBinaries.props')" /> |
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.
Version in folders = 😿
Could look into Paket to make working with Nuget easier?
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 not to well versed in Paket. I'm really not against giving a try, but I'd rather assess it post 1.0.
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.
@dahlbyk Those versions are managed by NuGet as part of the package update process. I'm not sure I see how you'd be able to avoid having those version numbers there since that's how NuGet works.
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.
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 not sure that being able to remove a version number from the path is a benefit that outweighs the cost of switching to entirely different package manager. That's one more thing someone would need to understand just to be able to contribute to the project.
Agreed. Easy enough to drop the trailing |
There's a PR for that! libgit2/libgit2#3269 |
91a28d0
to
05458fe
Compare
Hmmm Something weird happened: From https://ci.appveyor.com/project/libgit2/libgit2sharp/build/1091/job/jaovmnrhy66x3586
From https://ci.appveyor.com/project/libgit2/libgit2sharp/build/1092/job/b49m75hp4dc73w2y
This is running against latest libgit2 tip once #1113 has been merged |
This failure...
is expected because the prior test failed and did not unregister its filter. The |
Despite messing with the test code to try various things, I keep getting the same error:
The numbers are the same every time, I'm not sure what to make of them either as these two numbers do not appear to be any kind of magic numbers. These also happen to be very similar to the numbers AppVeyor is reporting.
|
Actual is expected << 1, just sayin'. |
Oh! Well spotted, @Therzok. I didn't see before. I guess that's a new kind of "off by one" error 😜 |
Just pushed up the following patch diff --git a/LibGit2Sharp.Tests/FilterFixture.cs b/LibGit2Sharp.Tests/FilterFixture.cs
index 5b89180..9f8d18f 100644
--- a/LibGit2Sharp.Tests/FilterFixture.cs
+++ b/LibGit2Sharp.Tests/FilterFixture.cs
@@ -177,7 +177,7 @@ public void WhenCheckingOutAFileFileSmudgeWritesCorrectFileToWorkingDirectory()
[Fact]
public void CanFilterLargeFiles()
{
- const int ContentLength = 128 * 1024 * 1024;
+ const int ContentLength = 128 * 1024 * 1024 + 17;
const char ContentValue = 'x';
char[] content = (new string(ContentValue, 1024)).ToCharArray();
Here are the new numbers
No longer a x2 issue. Padding? Buffering related? 268435456 = 256 * 1024 * 1024 |
diff --git a/LibGit2Sharp.Tests/FilterFixture.cs b/LibGit2Sharp.Tests/FilterFixture.cs
index 9f8d18f..6092970 100644
--- a/LibGit2Sharp.Tests/FilterFixture.cs
+++ b/LibGit2Sharp.Tests/FilterFixture.cs
@@ -177,7 +177,7 @@ public void WhenCheckingOutAFileFileSmudgeWritesCorrectFileToWorkingDirectory()
[Fact]
public void CanFilterLargeFiles()
{
- const int ContentLength = 128 * 1024 * 1024 + 17;
+ const int ContentLength = 128 * 1024 * 1024 - 13;
const char ContentValue = 'x';
char[] content = (new string(ContentValue, 1024)).ToCharArray(); produces
Interestingly, 268435456 - 268433408 = 2048. A buffer related issue somewhere? |
Well 134217728 was never I'm going to compare the number of callback invocations we receive in |
Looks like the |
OK so more digging I'm seeing callbacks in this order: init, create, write (various count), close, free. The interesting part is that I'd only expect to see these calls twice (once for clean and again When I'd only expect to see a pair of call sets: once for smudge and again for clean. Current we see clean set, clean set, smudge set, smudge set. Thoughts? |
string filename = Path.GetFileName(path); | ||
string cachePath = Path.Combine(root, ".git", filename); | ||
|
||
if (File.Exists(cachePath)) |
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.
@ethomson Is this implementation specific to this test or should something similar should always happen because of racy-git?
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.
This is unique to this test filter. When going to the ODB, it writes a temp file with the data and returns a unique ID. Then it tests that when going to the workdir, it can replace the data with what was written in the temp file. (This test is basically a poor man's git-media or git-lfs.)
However if your filter was invoked twice (by git re-examining racily clean files, for example) then we should clean up that temp file before trying to append to it. Otherwise you would end up with it duplicated.
@nulltoken Can we update this to the 0.23rc2? What's left to merge this? |
@ethomson On it |
c1969a5
to
c97b142
Compare
❤️ |
No description provided.