Verify if all repositories have a clean git config file

We are in a gitaly team have a ticket that requires us to make sure the git repository config file has no keys with particular names.

During lifetime of the repository and because of the different approaches we used to maintain the repository on the disk there might be some leftovers in the git repository config file that we are trying to remove by including a cleanup operation that run when GarbageCollect, OptimizeRepository or FetchIntoObjectPool RPCs are called. The cleanup code exists for quite some time and we want to remove it, but we need to make sure all git repositories have a "clean" config file.

The "dirty" config will produce output for the command:

git config --name-only --get-regex --local '^(http\..+\.extraheader|remote\..+\.(fetch|mirror|prune|url)|core\.(commitgraph|sparsecheckout|splitindex))$'

and the "clean" one won't.

We expect all repositories to produce no output, so nothing is needed and we are ready to remove the code in the gitaly project.
But if there are some repositories that still have a "dirty" configuration file we would need list of those to get back to them after some time and re-check again.

We should not change "dirty" config file manually because of the possible concurrency issues with other operations that operate on top of the repository. But we are OK in doing so if repository is untouchable (not served by the gitaly or access is limited by 0 or maybe a read-only).

Edited by Pavlo Strokov