Remove reliance on writing out `info/gitattributes`
Users can tweak various parts of how Git handles specific files in a repository via the gitattributes(5) mechanism. This file is part of the repository's tree via a simple `.gitattributes` file that may exist in either the top-level tree or any of the subtrees. Git does not support reading these files in bare repositories, and as a consequence we have specialized logic to handle them. Namely, the `ApplyGitattributes()` RPC is executed by clients whenever the main branch gets updated. The RPC then extracts any potentially-existing `.gitattributes` files from the root tree and writes it into `info/gitattributes` so that Git can pick it up. This implementation has several downsides: - We rely on the client to call the RPC, which violates separation of concerns. - We need to manually handle replication of this file. - Access to the file is inherently racy, e.g. when there are concurrent RPC calls that read and write it at the same point in time. - We can only respect the top-level `.gitattributes` file. Any files that exist in subtrees are ignored. We should get rid of this architecture and instead upstream a mechanism in git.git that allows reading `.gitattributes` files in arbitrary tree-ishs.
epic