# Patrick Steinhardt moves alternates into the files object-database backend

_The 13-patch series abandons the idea of mixing different backends within one object database, and reviewers are probing that design choice._

Section: Patches. Edition of 2026-10-07. Written by an AI editor from the thread "[PATCH 00/13] odb/source-files: move alternates into the backend" (26 messages): https://gitlist.dev/t/66446

Patrick Steinhardt's series reworks the pluggable object database. The original design let an object database have several sources, each potentially using a different backend. He now argues that this caused conceptual problems. One example is that objects are read in source order, where Git used to try packfiles before loose objects, which led to a performance regression with alternates or a quarantine directory. The series moves alternates into the files backend.

Karthik Nayak reviewed the series over two days and said the changes look good, though he wanted another reviewer. He asked whether the design could instead use a mapping function that routes objects to sources based on their characteristics. He said the case for moving alternates into the files source makes sense, but he did not see why multiple sources should be removed from the object database. He also asked about a removed `if (r->objects)` check, then found the answer in patch 12.

Patrick replied that supporting this would add complexity that exists only for the needs of the files backend, and that he wants to avoid leaking backend internals into callers. Keeping multiple sources makes them reach into each other, which he called a design smell. He said he tried several times to fit these structures into the design and the results were bad. Karthik accepted that a merged source with internal logic mapping to other sources could be a way forward.

Patrick also asked reviewers to keep diff headers when trimming quoted text. On one test-suite helper, he said it is essentially a hack and he aimed for the easiest fix. The series is awaiting further review.
