Usually a child process inherits the whole environment of its parent. The hook you are running is a child process spawned from a parent, that spawns another child process. Since parents do not inherit from childs you won't get this to work.
You only chance is reading the commit hash and thus extracting the username. Or what you already did, which I think is a proper solution, using a config file for data exchange. -- You received this message because you are subscribed to the Google Groups "GitLab" group. To unsubscribe from this group and stop receiving emails from it, send an email to gitlabhq+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/gitlabhq/18419efc-ef7a-4c0e-aad7-32ef808155f9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.