Custom Python ODB backends - write() support
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 32/100
Research direction
Start by reproducing the custom MyOdbBackend.write() example and the failure at repo.create_blob(). Read the OdbBackend and add_backend interfaces plus the related documentation to determine whether write() is supported. Done means the behavior is either implemented and verified with this example or clearly documented with the limitation and error cause.
Written by the indexing model from the issue text.
Description
Is there any support for implementing write() for custom python ODB backends?
I noticed it wasn't in the docs, but tried implementing it like so:
class MyOdbBackend(pygit2.OdbBackend):
# snip - other OdbBackend methods
def write(self, oid, data, length, type):
print(f"writing {oid} {length} type {type}")
return True
repo = pygit2.Repository()
odb = pygit2.Odb()
odb.add_backend(MyOdbBackend(), 1)
repo.set_odb(odb)
test_blob_id = repo.create_blob(b"hello world\n")
print(repo[test_blob_id].data)
But I get a _pygit2.GitError: TLS backend doesn't support certificate locations on calling repo.create_blob(). The built-in backends seem to work fine.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 408
- Avg merge
- 2d 57m
- Merged PRs (30d)
- 7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from libgit2/pygit2
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
learningequality/ricecooker#747 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
run-llama/llama_index#23199 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
KhronosGroup/glTF-Blender-IO#2769 ·