Pass single serialized struct instead of sets of envvars to child processes
When spawning external processes like Git where we need to pass down information, we currently use a set of environment variables. This mechanism is really hard to discover and easy to get wrong in case one forgets about one of the environment variables. Furthermore, there is no single source of truth about which envvars are actually expected by the child process.
Instead of passing dozens of envvars down, we may refactor the code to instead always pass a single environment variable only. This variable is then expected to be a serialized struct which contains all information relevant to the child process. This allows easy discoverability of all required or optional keys in a central location which is thus easy to change and construct, ending the proliferation of new envvars. It would also greatly improve documentation as we can document the actual purpose of each of the structure's members.