Christoph Weiss reported that after his team's internal Forgejo instance moved from version 16 to 17, many repository health checks started failing. The update brought Git from 2.52 to 2.54, which changed the default maintenance strategy from gc to geometric. He attached a shell script that he hopes reproduces the problem with geometric.

The report's title says geometric maintenance prunes commits without updating the commit-graph, so the graph can refer to commits that no longer exist.

Patrick Steinhardt replied that the report makes sense. His proposed fix is to move commit-graph generation into odb_optimize(). That would give Git more control over when graphs are written, and it could tell whether any objects were discarded, in which case it would rewrite the commit graph.

He said this fits his other in-flight series, which makes commit graphs pluggable. Once they are an implementation detail of the object database backend, he argued, writing them as part of odb_optimize() is the natural place.

The catch is timing. Steinhardt said he can only fix this once that other series has landed, because any fix made now would conflict with it. No interim workaround was discussed in the excerpts.