You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 26, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 26, 2026. It is now read-only.
Empty read from gitdb.OStream.read() before EOF #120
However the leading if dcompdat and means that the condition doesn't apply if zero bytes were read. Removing this part of the condition addresses the issue (but I understand from the comment that this is in order to support compressed_bytes_read()).
it's better to use the git command wrappers provided in GitPython.
GitCmdObjectDB? I've found previously that git cat-file --batch is 16 times slower that gitdb, which is substantial when our monorepo is 200GB. But I do agree that the implementation can't be trusted - I tried using a gitdb instance in threads (but with independent reads) and saw corrupted data. I've also found the best interface to git is generally to wrap git commands. Direct object DB access is the one case where that isn't fast enough and for that I've been using gitdb cautiously.
For the current application I just need to re-hash previously unseen trees/blobs using a different hashing scheme to git, and it has been working OK. Maybe I should re-run the git checksums as well as a sanity check; it would probably still be faster than a git pipe, and then I could debug any issues I detect.
Ah, maybe I should try pygit2. We also had a terrible time with libgit2 in a different application, we swore off it. But that may have been more about the bindings (node-git).
I am happy using Rust in CLI tools but our internal auth stack is not available in Rust, and the two services where we use/could use gitdb would not be cost-effective to rewrite in Rust.
I thought more in the direction of having a little CLI that performs a specific task, to shell out to from the main application. Alternatively, one could do the same but generate bindings.
Ultimately, if GitDB works (with some additional protections), then why not use it. But 200GB seemed like one would want to go native.
Activity
lordmauve commentedon Apr 16, 2025
If I print all chunk sizes with
there's a spread of sizes:
which seems to refute the idea expressed in this comment that it will recursively read() until the requested
sizeis filled:gitdb/gitdb/stream.py
Lines 310 to 312 in f36c0cc
Removing
if dcompdat and:[-]Empty read from gitdb.OSteam.read() before EOF[/-][+]Empty read from gitdb.OStream.read() before EOF[/+]Byron commentedon Apr 16, 2025
Thanks for reporting!
I don't think, however, that the implementation can be trusted and it's better to use the
gitcommand wrappers provided in GitPython.Getting a chunk of size 0 in the middle is certainly unexpected, but maybe if that's fixed it will be suitable for consumption nonetheless?
lordmauve commentedon Apr 18, 2025
GitCmdObjectDB? I've found previously thatgit cat-file --batchis 16 times slower that gitdb, which is substantial when our monorepo is 200GB. But I do agree that the implementation can't be trusted - I tried using agitdbinstance in threads (but with independent reads) and saw corrupted data. I've also found the best interface to git is generally to wrap git commands. Direct object DB access is the one case where that isn't fast enough and for that I've been usinggitdbcautiously.For the current application I just need to re-hash previously unseen trees/blobs using a different hashing scheme to git, and it has been working OK. Maybe I should re-run the git checksums as well as a sanity check; it would probably still be faster than a git pipe, and then I could debug any issues I detect.
Byron commentedon Apr 18, 2025
I see. In this case I'd recommend using
pygit2instead if it must be python, or go straight to Rust andgitoxide(orgit2).lordmauve commentedon Apr 18, 2025
Ah, maybe I should try pygit2. We also had a terrible time with libgit2 in a different application, we swore off it. But that may have been more about the bindings (node-git).
I am happy using Rust in CLI tools but our internal auth stack is not available in Rust, and the two services where we use/could use
gitdbwould not be cost-effective to rewrite in Rust.Byron commentedon Apr 18, 2025
I thought more in the direction of having a little CLI that performs a specific task, to shell out to from the main application. Alternatively, one could do the same but generate bindings.
Ultimately, if GitDB works (with some additional protections), then why not use it. But 200GB seemed like one would want to go native.
Merge pull request #135 from mvanhorn/fix/120-empty-read-before-eof
Fix DecompressMemMapReader.read returning b'' before EOF