##// 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 ## number of commits stats will parse on each iteration
117 ## number of commits stats will parse on each iteration
118 commit_parse_limit = 25
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 ## path to git executable
129 ## path to git executable
121 git_path = git
130 git_path = git
122
131
@@ -211,6 +211,18 b' use_htsts = false'
211 <%text>## number of commits stats will parse on each iteration</%text>
211 <%text>## number of commits stats will parse on each iteration</%text>
212 commit_parse_limit = 25
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 <%text>## path to git executable</%text>
226 <%text>## path to git executable</%text>
215 git_path = git
227 git_path = git
216
228
@@ -727,8 +727,11 b' class ScmModel(object):'
727 Git hook scripts so they invoke Kallithea code with the right Python
727 Git hook scripts so they invoke Kallithea code with the right Python
728 interpreter and in the right environment.
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 # FIXME This may not work on Windows and may need a shell wrapper script.
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 or '/usr/bin/env python2')
735 or '/usr/bin/env python2')
733
736
734 def install_git_hooks(self, repo, force_create=False):
737 def install_git_hooks(self, repo, force_create=False):
General Comments 0
You need to be logged in to leave comments. Login now