What
Thirteen compiled example binaries are tracked in git, totalling 502 MB on disk. They are all present in HEAD, introduced by #38.
41.8 MB example/router-integration/gin-integration/gin-integration-example
40.8 MB example/router-integration/fiber-integration/fiber-integration-example
39.1 MB example/router-integration/echo-integration/echo-integration-example
39.0 MB example/security-examples/echo/echo-secured-example
38.3 MB example/security-examples/chi/chi-secured-example
38.0 MB example/function-trace-example/function-trace-example-monigo
37.9 MB example/monigo-example
37.8 MB example/security-examples/ip-whitelist-example/ip-whitelist-example
37.8 MB example/security-examples/basic-auth/basic-auth-example
37.8 MB example/security-examples/api-key/api-key-example
37.8 MB example/router-integration/gorilla-mux-integration/gorilla-mux-integration-example
37.7 MB example/security-examples/custom-auth/custom-auth-example
37.7 MB example/router-integration/standard-mux-integration/standard-mux-integration-example
GitHub reports the repository as 240 MB. That is what every contributor downloads to work on a library whose source is a few hundred kilobytes.
They are not useful to anyone
$ file example/monigo-example
example/monigo-example: Mach-O 64-bit executable arm64
macOS arm64. They will not run on Linux CI, on Windows, on an Intel Mac, or in any container. They are rebuildable in seconds with go build. There is no scenario in which a checked-in copy is the thing someone needs.
There is an irony worth naming: the dashboard payload was just cut from 7.9 MB to 360 KB because every byte ships in consumers' binaries. Half a gigabyte sits in the repo that every contributor pays for.
Two halves, with different costs
Half one: stop it growing — safe, do now
git rm --cached <the 13 files>
# .gitignore: ignore built example binaries
No history rewrite, nothing breaks, no clone is invalidated. But the clone stays 240 MB forever, because the blobs remain in history.
The .gitignore needs a rule that actually catches them. They have no common suffix (-example, -monigo, …-example), so the reliable approach is to ignore each example directory's build output by name, or adopt a convention (bin/) and have the examples build there.
Half two: shrink the clone — effective, and it breaks things
git filter-repo --strip-blobs-bigger-than 5M followed by a force-push takes the clone from 240 MB to roughly 15 MB (current size-pack without the binaries is 14.9 MiB).
The cost is real and should not be waved away:
- Every one of the 19 forks is invalidated. Their history diverges from the rewritten one; merging becomes painful.
- Every existing clone must
git fetch --all && git reset --hard origin/main, and any open work rebased.
- Tags must be re-pushed.
v1.4.1 and v1.5.0 are already published to the Go module proxy — the proxy caches by content hash, so rewriting the commits those tags point at means the proxy's copy no longer matches the repo. Existing consumers keep working from the proxy cache; this needs checking before anything is rewritten, because getting it wrong breaks go get for everyone.
Recommendation
Do half one now. It is safe, it is a five-line change, and it stops the problem compounding.
Treat half two as a scheduled event, not a cleanup. If it happens: announce it on the repo first, give fork owners a window, do it at a quiet moment, and verify the module proxy still serves v1.4.1 and v1.5.0 afterwards. 240 MB is a genuine barrier to contribution for a 410-star project, so it is worth doing — but on purpose, not as a side effect of tidying.
Also worth folding in
.gitignore currently has /bin and nothing that catches these. A convention of building examples into an ignored directory would prevent recurrence better than listing thirteen paths.
What
Thirteen compiled example binaries are tracked in git, totalling 502 MB on disk. They are all present in
HEAD, introduced by #38.GitHub reports the repository as 240 MB. That is what every contributor downloads to work on a library whose source is a few hundred kilobytes.
They are not useful to anyone
macOS arm64. They will not run on Linux CI, on Windows, on an Intel Mac, or in any container. They are rebuildable in seconds with
go build. There is no scenario in which a checked-in copy is the thing someone needs.There is an irony worth naming: the dashboard payload was just cut from 7.9 MB to 360 KB because every byte ships in consumers' binaries. Half a gigabyte sits in the repo that every contributor pays for.
Two halves, with different costs
Half one: stop it growing — safe, do now
No history rewrite, nothing breaks, no clone is invalidated. But the clone stays 240 MB forever, because the blobs remain in history.
The
.gitignoreneeds a rule that actually catches them. They have no common suffix (-example,-monigo,…-example), so the reliable approach is to ignore each example directory's build output by name, or adopt a convention (bin/) and have the examples build there.Half two: shrink the clone — effective, and it breaks things
git filter-repo --strip-blobs-bigger-than 5Mfollowed by a force-push takes the clone from 240 MB to roughly 15 MB (currentsize-packwithout the binaries is 14.9 MiB).The cost is real and should not be waved away:
git fetch --all && git reset --hard origin/main, and any open work rebased.v1.4.1andv1.5.0are already published to the Go module proxy — the proxy caches by content hash, so rewriting the commits those tags point at means the proxy's copy no longer matches the repo. Existing consumers keep working from the proxy cache; this needs checking before anything is rewritten, because getting it wrong breaksgo getfor everyone.Recommendation
Do half one now. It is safe, it is a five-line change, and it stops the problem compounding.
Treat half two as a scheduled event, not a cleanup. If it happens: announce it on the repo first, give fork owners a window, do it at a quiet moment, and verify the module proxy still serves
v1.4.1andv1.5.0afterwards. 240 MB is a genuine barrier to contribution for a 410-star project, so it is worth doing — but on purpose, not as a side effect of tidying.Also worth folding in
.gitignorecurrently has/binand nothing that catches these. A convention of building examples into an ignored directory would prevent recurrence better than listing thirteen paths.