The shebang for git hooks is determined via: (kallithea/model/scm.py)
tmpl_pre = "#!/usr/bin/env %s\n" % sys.executable or 'python2'
When Kallithea is run via uwsgi, 'sys.executable' is the uwsgi process, not the python interpreter. As a result, pushing to a git repo gives following error:
$ git push Password for 'http://user@localhost:5050': Enumerating objects: 3, done. Counting objects: 100% (3/3), done. Writing objects: 100% (3/3), 241 bytes | 241.00 KiB/s, done. Total 3 (delta 0), reused 0 (delta 0) remote: unable to load configuration from hooks/pre-receive To http://localhost:5050/gitrepo-new ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'http://user@localhost:5050/gitrepo-new'
There is a second issue reported on IRC by where the shebang uses '/usr/bin/python' when Kallithea is started using Apache+WSGI. It may or may not be the same issue).