Skip to content
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

Custom refdb backend support #1739

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open

Conversation

sterlind
Copy link

This is a rewrite of zoxiv's refdb backend PR #1482 (their code here), since that targeted an ancient libgit2 with substantial API changes since then.

Changes due to libgit2:

  • Iterators had to be completely reworked, since foreach and foreach_glob were replaced with a new iterator callback in libgit2. Replaced them with a method that returns IEnumerable<ReferenceData>.
  • libgit2 now "requires" reflog support for backends. I've created stubs for these callbacks, since those APIs are cumbersome, they're not called unless reflog tracking is opted into, and most use cases for custom RefDbs don't require reflog support.

Other changes:

  • Added rename support.
  • Used RefdbBackendExceptions to signal errors, which simplifies the glue and lets native libgit2 error codes be returned.

@sterlind
Copy link
Author

It looks like AppVeyor failed with some build machine issue:

git clone -q https://github.com/libgit2/libgit2sharp.git C:\projects\libgit2sharp
fatal: unable to access 'https://github.com/libgit2/libgit2sharp.git/': Failed to connect to github.com port 443: Timed out
Command exited with code 128

Could a maintainer please rerun the check?

…lic) return IntPtr. This is safe, since libgit2 disposes te handles after consuming them, and allocating the handles is the last thing the callbacks do, so no exceptions can cause leaks.
@workgroupengineering
Copy link

is there any hope this pr will be merged?

@kstrohminfor
Copy link

@bording Is it possible for you to look at this? We utilitize the features this PR adds as well and have to maintain our own fork.

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.

3 participants