‹ BackHN Continuity

Thread

You can run Git on object storage if you re-make packfiles

148 points · 35 comments · evacchi

  1. mgrandl · · focus · HN ↗
    Sweet. It’s kinda wild to me that this hasn’t been done. Would be so much nicer if gitlab/forgejo/gitea/… supported object storage for everything. Currently you always still need a filesystem for git repos.
    1. everforward · · focus · HN ↗
      Doesn’t Git store data in sparse files? My impression is that git’s on-disk layout is exactly the kind of thing you’d avoid on object storage. Interactions involve a ton of small reads, resulting in poor performance and enormous bills.

      It only really makes sense to tarball repos into cold storage on S3 or Glacier, but short of GitLab cloud I suspect there aren’t enough repos cold enough to be worth the dev costs.

      S3 that doesn’t have wild costs for git objects sounds like it’s just NFS

      1. masklinn · · focus · HN ↗
        Git does not use sparse files no, however in packs objects are delta-ified: any object can be either literal or a combination of literal segments and range copies from a base object, and that base object can be the same, recursively. So to resolve any object you need to jump around a fair bit in the pack file. The normal GC creates delta chain of length 10, aggressive defaults to 50, the maximum is 4095.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.