2

There's a project in our company that features a complex file sync scenario and naturally git came up as a solution. As it is a .net project, libgit2sharp was exactly the API we were looking for.

As it seems from nullpointer's response to this thread, merge is still not implemented and not being able to merge changes from a remote branch could lead us to think on another way to solve this (and we wouldn't like to since the tests we already did with libgit2sharp were really successful).

Is there a possibility or alternative to provide remote merging? Will it be released in the short term?

Thanks in advance.

Community
  • 1
  • 1
Mauro2
  • 1,235
  • 1
  • 7
  • 9

2 Answers2

3

Will it be released in the short term?

Merge is bound to be implemented. However, there's no timeline yet. First, this Pull request has to be finalized as part of the ligit2 project. Maybe some additional higher level APIs will also be required. Then it will be made available through LibGit2Sharp.

Is there a possibility or alternative to provide remote merging?

Have you considered temporarily shelling out to "git.exe"?

This is what GitHub for Windows and Git-Tfs do, for instance.

Partly leveraging LibGit2Sharp, and partly relying on git.exe for everything which is not available yet.

Then, once a required feature has been added to LibGit2Sharp, replace the call to git.exe with a call to LibGit2Sharp.

Provided you've put in place some light abstraction layer and some unit tests, this shouldn't be a too bumpy road.

Update

Merge feature is now available in LibGit2Sharp (see pull request #608)

nulltoken
  • 64,429
  • 20
  • 138
  • 130
  • Thanks for the quick answer. We'll explore that possibility. – Mauro2 Apr 24 '13 at 20:34
  • Nice answer. Git-tfs is in the process of switching from shelling out to using LibGit2Sharp so shelling out to git is a totally viable option. – Daniel Lee Apr 24 '13 at 21:24
  • I would guess there are several who have already done this - is this on github or another open source repo somewhere? – Chris Moschini Aug 19 '13 at 05:08
  • @ChrisMoschini Here's the link ot the **[git-tfs repository](https://github.com/git-tfs/git-tfs)** – nulltoken Aug 19 '13 at 06:10
  • @nulltoken would you guys consider adding a NuGet publish step to your codebetter teamcity build? Eg adding a build step that pushes a pre-release .nupkg file v0.X.0.{BuildNumber} to nuget.org? – grenade Jan 30 '14 at 17:51
  • @grenade If you feel like giving a hand to set it up, I'm open to this. Maybe this discussion would be a better fit for the LibGit2Sharp issue tracker, though ;-) – nulltoken Jan 30 '14 at 18:34
  • @nulltoken I'd be honoured to have even the tiniest involvement in the LibGit2Sharp project. https://github.com/libgit2/libgit2sharp/issues/273#issuecomment-33772638 – grenade Jan 31 '14 at 09:43
2

Since 16/01/2014, merge has been available but as of 23/01/2014, not on NuGet.

To use it anyway, replace the LibGit2Sharp.dll and LibGit2Sharp.xml files in your dependencies folder (maybe: .../your-solution-folder/packages/LibGit2Sharp.0.15.0.0/lib/net35) with the ones from the artifacts of the last successful (green) CodeBetter CI build.

The ones from January 22nd are a drop in replacement and are still marked as v 0.15.0.0 in the assembly properties so it doesn't confuse the NuGet package manager when you manually replace the dll.

I should add that merge works a treat. Those libgit2sharp folks are bloody smart!

grenade
  • 31,451
  • 23
  • 97
  • 126