On Fri, Dec 11, 2020 at 09:27:57AM -0500, Jeff King wrote: > I don't know what kinds of variables you want to set exactly, but > another possible option here is some mechanism to point Git to an extra > config file. This would work if you are setting a bunch of options in > some static way, but not if you're setting them to custom values for > each command invocation (because then you'd be dealing with a temp file, > which is annoying and error-prone). > > I'm thinking something like a $GIT_CONFIG_ENV_FILE that is parsed after > repo config but before $GIT_CONFIG_PARAMETERS. One more (probably insane) idea, that you are free to ignore unless it sparks your interest. $GIT_CONFIG_ENV could contain an actual config-file snippet itself. I.e.: GIT_CONFIG_ENV=' [foo] bar = value [another "section"] key = "more complicated value" ' In fact, we could have implemented $GIT_CONFIG_PARAMETERS that way from the very beginning. I'd be hesitant to change it now, though. It doesn't really make your quoting problem go away, in that you'd now have to generate a valid and correct config file, which is even more complicated than shell-quoting. :) But it is at least a well-documented format whose generator might be used for other things, too. -Peff