##// END OF EJS Templates
hooks: make the Python interpreter for Git hooks configurable as 'git_hook_interpreter' (Issue #333)...
Thomas De Schampheleire -
r7538:1bafb2d0 stable
parent child Browse files
Show More
@@ -117,6 +117,15 b' use_htsts = false'
117 117 ## number of commits stats will parse on each iteration
118 118 commit_parse_limit = 25
119 119
120 ## Path to Python executable to be used for git hooks.
121 ## This value will be written inside the git hook scripts as the text
122 ## after '#!' (shebang). When empty or not defined, the value of
123 ## 'sys.executable' at the time of installation of the git hooks is
124 ## used, which is correct in many cases but for example not when using uwsgi.
125 ## If you change this setting, you should reinstall the Git hooks via
126 ## Admin > Settings > Remap and Rescan.
127 # git_hook_interpreter = /srv/kallithea/venv/bin/python2
128
120 129 ## path to git executable
121 130 git_path = git
122 131
@@ -211,6 +211,18 b' use_htsts = false'
211 211 <%text>## number of commits stats will parse on each iteration</%text>
212 212 commit_parse_limit = 25
213 213
214 <%text>## Path to Python executable to be used for git hooks.</%text>
215 <%text>## This value will be written inside the git hook scripts as the text</%text>
216 <%text>## after '#!' (shebang). When empty or not defined, the value of</%text>
217 <%text>## 'sys.executable' at the time of installation of the git hooks is</%text>
218 <%text>## used, which is correct in many cases but for example not when using uwsgi.</%text>
219 <%text>## If you change this setting, you should reinstall the Git hooks via</%text>
220 <%text>## Admin > Settings > Remap and Rescan.</%text>
221 # git_hook_interpreter = /srv/kallithea/venv/bin/python2
222 %if git_hook_interpreter:
223 git_hook_interpreter = ${git_hook_interpreter}
224 %endif
225
214 226 <%text>## path to git executable</%text>
215 227 git_path = git
216 228
@@ -727,8 +727,11 b' class ScmModel(object):'
727 727 Git hook scripts so they invoke Kallithea code with the right Python
728 728 interpreter and in the right environment.
729 729 """
730 # Note: sys.executable might not point at a usable Python interpreter. For
731 # example, when using uwsgi, it will point at the uwsgi program itself.
730 732 # FIXME This may not work on Windows and may need a shell wrapper script.
731 return (sys.executable
733 return (kallithea.CONFIG.get('git_hook_interpreter')
734 or sys.executable
732 735 or '/usr/bin/env python2')
733 736
734 737 def install_git_hooks(self, repo, force_create=False):
General Comments 0
You need to be logged in to leave comments. Login now