The GIT_AUTHOR_NAME environment variable is set every time I start a terminal in Jupyterlab, and I cannot figure out where it is set, or how to unset it permanently. I would be interested in not having this variable set for any user on the deployment if possible, because it overrides the user name in .gitconfig, and it does not get full/correct names. Why is this variable set for users, and is there any way of disabling this behavior? Thanks!
I am currently using jupyterhub-v0.7-e2757f0.
Do you have nbgitpuller installed? It might be related.
The Dockerfile for the Hub includes this config for JupyterHub, configuring kubespawner like this.

In other words - override the kubespawner environment.
Hmmm, perhaps we could make this in a way that would honor the users .gitconfig but acts as a fallback if the user doesn't have it? Can you have a default .gitconfig and a specific users .gitconfig?
It seems like there are various configs...
scope|location|flag|note
-|-|-|-
System|/etc/gitconfig|--system|
User|~/.gitconfig|--global|
Repo|.git/config||
GIT_AUTHOR_NAME? For nbgitpuller?There is a technical challenge of writing a custom file to the predefined docker image, perhaps using a kubernetes start hook, declared to be user specific, by the kubespawner, using a kubespawner pre_spawn_hook... ehh... this is a bit much...
Thanks @consideRatio! I was able to change this behavior by setting:
c.KubeSpawner.environment = {}
It's a bit surprising that these variables are being set by default as I cannot see how they would ever be what the user would want. I would guess that most users aren't using git inside jupyter, but those that are would be using a .gitconfig. There was some discussion about reworking these variables in #548, but my opinion is that they should not be set at all. Something to consider.
This is a leftover from very early days, before zero to jupyterhub was fully extracted from the various deployments that spawned it. I'd welcome a PR that removes it :)
Glad you could find a workaround, @tjcrone! Thank you for the explanation & help, @consideRatio :)
Why do we pre-setup GIT_AUTHOR_NAME? For nbgitpuller?
I suspect that's why, and as @yuvipanda mentions, it's probably not necessary or appropriate anymore. I think nbgitpuller doesn't work (or didn't) without it, but we probably shouldn't do this by default, with the possible exception of setting from a more-likely-to-be-correct value from certain authenticators, such as GitHub
We can also set these from nbgitpuller itself, if it doesn't work. nbgitpuller has been rewritten a number of times since this was set up.
Note that in #888 we added nbgitpuller to the default singleuser-sample image