Update blueline #176

Merged
merged 75 commits into from Jun 12, 2012

Conversation

Projects
None yet
6 participants
Contributor

aroben commented Jun 9, 2012

This updates blueline to match vNext, and also pulls in a new build of libgit2.

How about renaming it to ParentsCount?

Member

tclem replied Feb 10, 2012

Sure

Member

nulltoken commented on 29ea14e Feb 10, 2012

Nice addition! Thanks as always :)

Renamed the property to ParentsCount and manually merged into vNext.

paulcbetts added some commits Feb 14, 2012

Merge remote-tracking branch 'origin/vNext' into blueline
Conflicts:
	Lib/NativeBinaries/x86/git2.dll
	Lib/NativeBinaries/x86/git2.pdb
	LibGit2Sharp.Tests/CommitFixture.cs
	LibGit2Sharp/Commit.cs
	LibGit2Sharp/Core/NativeMethods.cs
	LibGit2Sharp/IndexEntry.cs
	LibGit2Sharp/Signature.cs
Member

nulltoken commented on d2d4270 Feb 14, 2012

@xpaulbettsx @tclem This is weird as I was pretty sure the Untracked case was covered.

Could you help me creating a unit test for this by describing how to reproduce this behavior? Thanks in advance.

Member

arrbee replied Feb 14, 2012

Can you tell me what the errorMessage is that is being generated in this case? I'm curious where the ENOTFOUND is being generated. I'm guessing the message will read something like "Failed to process the file '%s'. It doesn't exist in the workdir, in the HEAD not in the index".

I'm curious to know more because I suspect this could be a change in behavior stemming from my attempt to ignore submodules (i.e. a submodule might be leaving the status iterators in an inconsistent state).

Member

nulltoken replied Mar 6, 2012

@arrbee Have you had the opportunity to discuss this further with Tim and Paul?

Member

nulltoken replied Mar 18, 2012

@xpaulbettsx @tclem @arrbee Would you be so kind as to check if d2d4270 is still required with libgit2/libgit2#601?

paulcbetts and others added some commits Feb 21, 2012

Fix up marshalling of strings returned by libgit2
Previously we were doing this which is not good:

return Marshal.PtrToStringAnsi(intPtr);

You can see the failing test that was added to ConfigurationFixture.cs to
demonstrate the problem (setting and getting a user name with unicode chars in
the config). This brought up the large problem of how we were dealing with
libgit2 methods that returned string values.

There was another subtle issue in the Utf8Marshaler where we were freeing
memory that we didn't own.
Member

nulltoken commented on a7a22bb Mar 6, 2012

Cherry picked onto vNext

Member

nulltoken commented on 50975b9 Mar 6, 2012

Awesome!

Few notes:

  • I manually merged it on vNext
  • I also took the liberty to fix your first name, Juliën ;-) (as the author of this commit)
  • Are you sure about the comment in the new test? In my understanding, calling Set() eventually invokes Save(), so according to me, there's no need to dispose the Configuration to flush the changes to disk
Member

tclem replied Mar 6, 2012

I manually merged it on vNext

Awesome!

I also took the liberty to fix your first name, Juliën ;-) (as the author of this commit)

LOL, should probably check that - I was trying to figure out where in the stack unicode chars where getting munged. :)

Are you sure about the comment in the new test?

No, I'm not sure now that you mention it. It would be simple to alter that test and be sure. I thought that Set() didn't actually flush changes to the disk, but I honestly haven't looked at that code.

Haacked and others added some commits Mar 8, 2012

Added some interfaces to some classes
We need some interfaces to make writing isolated unit tests of our code easier. Note that this is just a start. I didn't take it to its logical conclusion. I just refactored just enough for what we need.
Member

nulltoken commented on a09e5b0 Apr 7, 2012

Cherry-picked and merged into vNext.

aroben and others added some commits Apr 23, 2012

Update-NativeBinaries.ps1: Add Run-Command function
This centralizes our error handling into one place.
Update-NativeBinaries.ps1: Add -NoClar option
This allows skipping the building/running of libgit2's Clar-based test
suite, which is useful for folks who don't have Python installed.
Merge remote-tracking branch 'origin/vNext' into blueline-new-error-h…
…andling

Conflicts:
	Lib/NativeBinaries/x86/git2.dll
	Lib/NativeBinaries/x86/git2.pdb
	LibGit2Sharp.Tests/BranchFixture.cs
	LibGit2Sharp.Tests/CommitFixture.cs
	LibGit2Sharp.Tests/IndexFixture.cs
	LibGit2Sharp.Tests/ReferenceFixture.cs
	LibGit2Sharp.Tests/RepositoryFixture.cs
	LibGit2Sharp.Tests/TagFixture.cs
	LibGit2Sharp/Branch.cs
	LibGit2Sharp/BranchCollection.cs
	LibGit2Sharp/CommitCollection.cs
	LibGit2Sharp/Core/Ensure.cs
	LibGit2Sharp/Core/NativeMethods.cs
	LibGit2Sharp/Core/Utf8Marshaler.cs
	LibGit2Sharp/GitObject.cs
	LibGit2Sharp/Index.cs
	LibGit2Sharp/LibGit2Exception.cs
	LibGit2Sharp/ObjectDatabase.cs
	LibGit2Sharp/Reference.cs
	LibGit2Sharp/ReferenceCollection.cs
	LibGit2Sharp/Remote.cs
	LibGit2Sharp/RemoteCollection.cs
	LibGit2Sharp/Repository.cs
	LibGit2Sharp/RepositoryExtensions.cs
Fix up tests to account for new message cleanup
libgit2 now cleans up (adds newline to end, etc.) to tags and commit
messages.
Merge branch 'topic/check-binding' of https://github.com/nulltoken/li…
…bgit2sharp into blueline

Conflicts:
	Lib/NativeBinaries/x86/git2.dll
	Lib/NativeBinaries/x86/git2.pdb
	LibGit2Sharp/Core/Ensure.cs
	LibGit2Sharp/Core/GitError.cs
	LibGit2Sharp/Core/GitErrorCode.cs
	LibGit2Sharp/Core/NativeMethods.cs
	LibGit2Sharp/RemoteCollection.cs
	LibGit2Sharp/Repository.cs
Hack: Work around lookup not correctly returning ENOTFOUND
Failing test was

repo.Lookup<TagAnnotation>("8496071c1b46c854b31185ea97743be6a8774479").ShouldBeNull();
Remove trailing "\n" from commit and tag messages
Libgit2 now takes care of cleaning up the messages.
Merge branch 'topic/check-binding' of https://github.com/nulltoken/li…
…bgit2sharp into blueline

Conflicts:
	Lib/NativeBinaries/x86/git2.dll
	Lib/NativeBinaries/x86/git2.pdb
	LibGit2Sharp.Tests/BranchFixture.cs
	LibGit2Sharp/BranchCollection.cs
	LibGit2Sharp/Core/Ensure.cs
	LibGit2Sharp/Core/GitError.cs
	LibGit2Sharp/Core/GitErrorCode.cs
	LibGit2Sharp/Core/NativeMethods.cs
	LibGit2Sharp/RemoteCollection.cs
	LibGit2Sharp/Repository.cs
Merge remote-tracking branch 'origin/vNext' into blueline
Conflicts:
	Lib/NativeBinaries/x86/git2.dll
	Lib/NativeBinaries/x86/git2.pdb
	LibGit2Sharp.Tests/AttributesFixture.cs
	LibGit2Sharp.Tests/BranchFixture.cs
	LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj
	LibGit2Sharp/BranchCollection.cs
	LibGit2Sharp/Commit.cs
	LibGit2Sharp/Configuration.cs
	LibGit2Sharp/Core/Ensure.cs
	LibGit2Sharp/Core/GitError.cs
	LibGit2Sharp/Core/GitErrorCode.cs
	LibGit2Sharp/Core/Libgit2UnsafeHelper.cs
	LibGit2Sharp/Core/NativeMethods.cs
	LibGit2Sharp/LibGit2Sharp.csproj
	LibGit2Sharp/ObjectDatabase.cs
	LibGit2Sharp/PatchPrinter.cs
	LibGit2Sharp/RemoteCollection.cs
	LibGit2Sharp/Repository.cs
	LibGit2Sharp/RepositoryStatus.cs
	LibGit2Sharp/TreeChanges.cs
Merge remote-tracking branch 'origin/vNext' into blueline
Conflicts:
	Lib/NativeBinaries/x86/git2.dll
	Lib/NativeBinaries/x86/git2.pdb
	LibGit2Sharp.Tests/BranchFixture.cs
	LibGit2Sharp.Tests/CommitFixture.cs
	LibGit2Sharp.Tests/ReferenceFixture.cs
	LibGit2Sharp/Configuration.cs
	LibGit2Sharp/Core/Ensure.cs
	LibGit2Sharp/Core/GitError.cs
	LibGit2Sharp/RemoteCollection.cs
Merge remote-tracking branch 'origin/vNext' into blueline
Conflicts:
	LibGit2Sharp.Tests/IndexFixture.cs
	LibGit2Sharp.Tests/ReferenceFixture.cs
	LibGit2Sharp.Tests/ResetHeadFixture.cs
	LibGit2Sharp/CommitCollection.cs
	LibGit2Sharp/Core/Ensure.cs
	LibGit2Sharp/Core/GitError.cs
	LibGit2Sharp/Core/GitErrorCode.cs
	LibGit2Sharp/LibGit2Exception.cs
	LibGit2Sharp/Repository.cs
	LibGit2Sharp/RepositoryExtensions.cs
Make Update-NativeBinaries handle errors better
We now stop at the first error and don't leave you stranded in some
random directory.
Update-NativeBinaries.ps1: Don't require CMake to be in %PATH%
We still search for CMake in %PATH%, but then fall back to looking in
%ProgramFiles(x86)%.
@@ -1 +1,31 @@
-Add "1.txt" file beside "1" folder
+Remove executable bit from 1/branch_file.txt
@aroben

aroben Jun 9, 2012

Contributor

I had to do this to account for libgit2/libgit2#744.

@@ -33,7 +33,7 @@ public void CanOpenABareRepoAsIfItWasAStandardOne()
using (var repo = new Repository(BareTestRepoPath, options))
{
var st = repo.Index.RetrieveStatus("1/branch_file.txt");
- Assert.Equal(FileStatus.Missing, st);
+ Assert.Equal(FileStatus.Missing | FileStatus.Staged, st);
@aroben

aroben Jun 9, 2012

Contributor

This change was caused by the commit I added to testrepo_wd. I couldn't figure out a way to fix 1/branch_file.txt's mode without having to change this test too.

@@ -204,7 +204,7 @@ public void CanListAllBranchesIncludingRemoteRefs()
{
new { Name = "diff-test-cases", Sha = "e7039e6d0e7dd4d4c1e2e8e5aa5306b2776436ca", IsRemote = false },
new { Name = "i-do-numbers", Sha = "7252fe2da2c4dd6d85231a150d0485ec46abaa7a", IsRemote = false },
- new { Name = "master", Sha = "32eab9cb1f450b5fe7ab663462b77d7f4b703344", IsRemote = false },
+ new { Name = "master", Sha = "d82070ebae8d2cbea939b06513e78a24da76e5fd", IsRemote = false },
@aroben

aroben Jun 9, 2012

Contributor

This and the other changes in this file were necessitated by the extra commit I added to testrepo_wd.

- Tree parentCommitTree = repo.Head.Tip.Parents.Single().Tree;
+ var commit = repo.Lookup("32eab9cb1f450b5fe7ab663462b77d7f4b703344", GitObjectType.Commit) as Commit;
+ Tree commitTree = commit.Tree;
+ Tree parentCommitTree = commit.Parents.Single().Tree;
@aroben

aroben Jun 9, 2012

Contributor

This was necessitated by the commit I added to testrepo_wd. This test should now be more future-proof.

Contributor

aroben commented Jun 9, 2012

@nulltoken informs me that I had to change 1/branch_file.txt's mode because of a bug in libgit2. git_index_add is not correctly ignoring file modes. See @arrbee's comment about it.

So, we could wait for that bug to be fixed and redo this without the change to testrepo_wd. I don't know how soon @arrbee is planning to fix it though.

@tclem tclem merged commit 8e8d228 into blueline Jun 12, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment