Migrate to git-lfs due to *.a size #38

Open
opened 2026-11-13 19:57:35 +00:00 by decentral1se · 3 comments
Owner

The repo is getting a bit huge since 130992211a (~130MB on a fresh clone 🤦‍♀️). I made a slightly aborted attempt to migrate to git-lfs without really knowing what I'm doing 😆 This Gitea install does support it.

It doesn't seem to be possible to migrate to git-lfs in a repository and drop the size after files have been added in the past. So, I think I'd have to rewrite the history to rip the binaries out and add them with git-lfs from the start 😅

This would break any clones of this repository and might require running go mod tidy on any downstream projects. It may also require a go clean -cache or even worse, nuking deps via $GOPATH (go env | grep GOPATH).

I believe go get does support git-lfs. Or perhaps not 😬 I will investigate this because I'll need it for p2panda-go and who knows what else 😛 Once a workflow is found and confirmed, we could coordinate a switch over eventually. Not urgent now.

The repo is getting a bit huge since https://git.coopcloud.tech/decentral1se/iroh-go/commit/130992211a67ec213e202a1ae4c303950ece9853 (~130MB on a fresh clone 🤦‍♀️). I made a slightly aborted attempt to migrate to `git-lfs` without really knowing what I'm doing 😆 This Gitea install does [support it](https://docs.gitea.com/administration/git-lfs-setup/). It doesn't seem to be possible to migrate to `git-lfs` in a repository and drop the size after files have been added in the past. So, I think I'd have to rewrite the history to rip the binaries out and add them with `git-lfs` from the start 😅 This would break any clones of this repository and might require running `go mod tidy` on any downstream projects. It may also require a `go clean -cache` or even worse, nuking deps via `$GOPATH` (`go env | grep GOPATH`). I believe `go get` does [support `git-lfs`](https://stackoverflow.com/questions/58280942/import-a-golang-module-with-lfs-objects). Or [perhaps not](https://github.com/golang/go/issues/47241) 😬 I will investigate this because I'll need it for `p2panda-go` and who knows what else 😛 Once a workflow is found and confirmed, we could coordinate a switch over eventually. Not urgent now.
Collaborator

Haha yes I thought this would become an issue at some point X) I wonder if git-annex could be useful or if that makes less sense for a code repo. (Never used git-annex but seems like a really good project and have only heard good things abt it!)

Similarly, git-annex is not git-lfs, which also uses git smudge filters, and appears to lack git-annex's widely distributed storage and partial checkouts.

https://git-annex.branchable.com/not/

LWN on git-lfs vs git-annex: https://lwn.net/Articles/774125/

Haha yes I thought this would become an issue at some point X) I wonder if [`git-annex`](https://git-annex.branchable.com/) could be useful or if that makes less sense for a code repo. (Never used git-annex but seems like a really good project and have only heard good things abt it!) > Similarly, git-annex is not [git-lfs](https://github.com/github/git-lfs), which also uses git smudge filters, and appears to lack git-annex's widely distributed storage and partial checkouts. > > https://git-annex.branchable.com/not/ LWN on `git-lfs` vs `git-annex`: https://lwn.net/Articles/774125/
Author
Owner

I'm a fan of git-annex but I think the result is the same (because of golang/go#47241) - if we migrate, we can't just go mod tidy / go get / etc. because it won't bring over the binaries we need (it just brings over the text files which point to the binaries). So, this is kind of an existential threat to how simple our install method is right now (which we for sure need to try to keep) 🙈

I'm a fan of `git-annex` but I think the result is the same (because of [`golang/go#47241`](https://github.com/golang/go/issues/47241)) - if we migrate, we can't just `go mod tidy` / `go get` / etc. because it won't bring over the binaries we need (it just brings over the text files which point to the binaries). So, this is kind of an existential threat to how simple our install method is right now (which we for sure need to try to keep) 🙈
Collaborator

@decentral1se looked into the thread you pointed to in the op, and looks like lfs is landing in future go releases (maybe? X):

@decentral1se looked into the thread you pointed to in the op, and looks like lfs is landing in future go releases (maybe? X): * https://github.com/golang/go/issues/47308#issuecomment-4997405426 * https://go-review.googlesource.com/c/go/+/733080/1
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: decentral1se/iroh-go#38