Skip to content

draft: fix: handle varying compression ratios in pack file decoding#16

Draft
ketsapiwiq wants to merge 1 commit intoGitJournal:masterfrom
ketsapiwiq:fix/pack-file-decode-large-repos
Draft

draft: fix: handle varying compression ratios in pack file decoding#16
ketsapiwiq wants to merge 1 commit intoGitJournal:masterfrom
ketsapiwiq:fix/pack-file-decode-large-repos

Conversation

@ketsapiwiq
Copy link
Copy Markdown

Hi! I needed to add that fix to be able to clone my large repo with a lot of history in GitJournal.
However, as I don't know Dart or git that extensively, it's an LLM/agent/slop PR (GLM 5) (except this text is written by me).
It fixed my problem but code is probably not in a state you want, however maybe it will be an inspiration so I'm opening this PR as draft. Feel free to close it of course.

Sorry I can't give the repo that I'm now able to clone because, well, it's personal notes :p

Thanks a lot for the beautiful software.

The previous implementation assumed that reading objSize compressed bytes would always yield objSize decompressed bytes. This fails in large repos where compression ratios vary significantly.

Changed to iteratively read chunks until enough decompressed data is available, with proper error handling instead of assertion failure.

Fixes assertion error:
'outputSink.builder.length >= objSize': is not true

The previous implementation assumed that reading objSize compressed bytes
would always yield objSize decompressed bytes. This fails in large repos
where compression ratios vary significantly.

Changed to iteratively read chunks until enough decompressed data is
available, with proper error handling instead of assertion failure.

Fixes assertion error:
  'outputSink.builder.length >= objSize': is not true
@vHanda
Copy link
Copy Markdown
Contributor

vHanda commented Mar 28, 2026

Thanks for this. I'll test it out against my repos, and read a bit more and then probably merge it.

The long term plan is to to migrate to gitoxide and archive this project.

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.

2 participants