Git config is not owned by Gitaly
Description
In order for Gitaly to work correctly, we need to rely on correct configuration of git
on the Gitaly server. We don't have a lot of control over this, and looking at the Gitaly repo you cannot see the full picture of Git config.
- some Git settings are defined globally in omnibus
- these global Git settings are probably/hopefully also configured in CNG and source installations?
- some Git settings are put into individual repositories by gitlab-rails (separate problem)
- some Git settings are put into individual repositories by Gitaly (ignore, this is rare)
- some Git settings are put on the
git
command line by Gitaly (ignore, this is good)
Impact
It is very hard for people to understand what Git settings GitLab uses. It is hard to make global Git config changes. It is easy to overlook things.
What can we do
We need to push all gitlab-specific special git config from omnibus, source and CNG down into Gitaly.
Via #2220 (comment 251845832):
- The ideal solution is config that is applied to all Git processes we spawn via environment variables. There is a variable
GIT_CONFIG_PARAMETERS
but it's undocumented. - If we cannot use
GIT_CONFIG_PARAMETERS
directly, we can just stack up a long list of default-c
options: this is definitely public API ongit
and it has the same effect.
-
create global, process scoped Git config mechanism in Gitaly. Should also be used in gitaly-ruby! -
import gitlab-specific global config from omnibus, source, CNG into the new Gitaly global config -
(one release later) remove global config from omnibus, source, CNG
Cost of fixing
In terms of volume, one person can do this within a single milestone. The only complication is that in order to safely make a change like this, you need at least two releases: one to add the new stuff, and then one later to remove the old stuff.