`impl Read for OdbReader` breaks semantics of Read, and doesn't provide any indication of EOF
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 450
- Avg merge
- 11m
- Merged PRs (30d)
- 1
Description
The underlying git_odb_stream_read doesn't give any EOF indication, and instead seems to expect the caller to track the remaining bytes manually based on the object size.
As a result, the implementation of Read for OdbReader doesn't follow the normal semantics of Read; it always returns the length it was given, and never indicates EOF or a short read.
We could fix this relatively easily by tracking the object size ourselves, with one hiccup: OdbReader implements Binding, which doesn't give any opportunity to initialize the object further beyond the raw pointer.
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.
Research direction
Start by reading the Read implementation for OdbReader, the Binding trait, and the git_odb_stream_read call described in the issue. Trace how the object size could be retained during initialization without changing the raw-pointer binding contract. Done means reads follow normal short-read and EOF semantics while preserving the existing binding behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100