Skip to content

Custom refdb backend support#1739

Open
sterlind wants to merge 26 commits intolibgit2:masterfrom
sterlind:refdb-rewrite
Open

Custom refdb backend support#1739
sterlind wants to merge 26 commits intolibgit2:masterfrom
sterlind:refdb-rewrite

Conversation

@sterlind
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

is there any hope this pr will be merged?

@kstrohminfor
Copy link
Copy Markdown

@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