We're using clang-format in a git repository and we'd like to have one central .clang-format file that we maintain for all of our C/C++/proto code. We use submodules to share a "common" repository across multiple top-level "project" repositories. We would like each repository to have the same formatting rules, and for those rules to be centralized in the "common" repository.
In the following ASCII art, project1 is a leaf repository, and common is the shared submodule:
/project1 <-- leaf repository
.clang-format
/external
/common <-- submodule repository
.clang-format
At best, the two .clang-format files are copies. At worse, they diverge.
We don't want to change /project1/.clang-format to be a symlink, because we support Windows.
We saw the -style=file:<format_file_path> flag from the documentation, and that seems like it would work for a formatting tool. But, that solution is challenging for editors that don't have "project files" that can be checked in at the root of /project1- we would also like to support integrated clang-format LSP support in our editors, and that requires either a local .clang-format file being found, or a global editor being configured with very project-specific path details.
If clang-format supported configuration file references, then /project1/.clang-format could be a tiny file that just says "Use the contents of ./external/common/.clang-format" but that functionality doesn't appear to exist.
How can we avoid the duplication of .clang-format files given these constraints?