Patrick Steinhardt posted a 12-patch series that makes commit graphs pluggable. Today the location is hardcoded to ".git/objects/info". That suits the "files" backend, which keeps its other data there, but other backends may want to store commit graphs differently or not support them at all.

The series first moves the logic that derives commit-graph paths out of the generic commit-graph code and into the files backend (odb/source-files.c). The patch description calls this mostly an exact move, so that nothing else changing is easy to see. The only exception is three sites that now generate -Wsign-compare warnings. A follow-up patch refactors the moved code so the temporary declarations in commit-graph.h can be dropped.

Other patches prepare the ground. The incomplete out-parameter of load_commit_graph_chain_fd_st() becomes a field on the commit graph structure. Writing a layer is split from managing file locations and deleting old files. Writing a split graph no longer relies on redundant bookkeeping arrays in the write context. The check for whether writing is enabled is extracted. Two files-backend functions are exposed for git commit-graph, whose --object-dir option is specific to the files backend.

Steinhardt says he considered a different design, abstracting the commit graph's functionality rather than its storage location. He judged that a much larger undertaking and kept the data structure as is. He says a later series could abstract it further.

Junio C Hamano's first review of the series calls one change a "nice simplification". He welcomes the move away from counting layers in a signed int and the standardization on "0 means happy" error returns, and asks whether the log message should mention the latter. He also notes that the check that cur_g->oid matches the expected value is gone, because the array it was compared against no longer exists. He asks whether that member is now only written and used for reporting.

The series is at v1, and those questions are the open items so far.