[PATCH 2 of 6 v3] ini: introduce setting 'git_hook_interpreter'

Thomas De Schampheleire patrickdepinguin at gmail.com
Mon Apr 8 20:14:53 UTC 2019


# HG changeset patch
# User Thomas De Schampheleire <thomas.de_schampheleire at nokia.com>
# Date 1554751977 -7200
#      Mon Apr 08 21:32:57 2019 +0200
# Branch stable
# Node ID fa06015a39a0d757790a334207b4066beefee64f
# Parent  a4ad7b50bab39a528ac147ae3f50791434313127
ini: introduce setting 'git_hook_interpreter'

As preparation to fix issues with Git hooks that cannot be executed in all
cases due to an incorrect interpreter (issue #333), introduce a
configuration setting 'git_hook_interpreter'.

A subsequent commit will cause its value to be filled in automatically when
generating a new ini file, but an administrator can always override it.

diff --git a/development.ini b/development.ini
--- a/development.ini
+++ b/development.ini
@@ -117,6 +117,14 @@ use_htsts = false
 ## number of commits stats will parse on each iteration
 commit_parse_limit = 25
 
+## Path to Python executable to be used for git hooks.
+## This value will be written inside the git hook scripts as the text
+## after '#!' (shebang). When empty or not defined, the value of
+## 'sys.executable' at the time of installation of the git hooks is
+## used, which is correct in many cases but not when using uwsgi.
+## FIXME this setting is not yet used.
+# git_hook_interpreter = /srv/kallithea/venv/bin/python2
+
 ## path to git executable
 git_path = git
 
diff --git a/kallithea/lib/paster_commands/template.ini.mako b/kallithea/lib/paster_commands/template.ini.mako
--- a/kallithea/lib/paster_commands/template.ini.mako
+++ b/kallithea/lib/paster_commands/template.ini.mako
@@ -211,6 +211,17 @@ use_htsts = false
 <%text>## number of commits stats will parse on each iteration</%text>
 commit_parse_limit = 25
 
+<%text>## Path to Python executable to be used for git hooks.</%text>
+<%text>## This value will be written inside the git hook scripts as the text</%text>
+<%text>## after '#!' (shebang). When empty or not defined, the value of</%text>
+<%text>## 'sys.executable' at the time of installation of the git hooks is</%text>
+<%text>## used, which is correct in many cases but not when using uwsgi.</%text>
+<%text>## FIXME this setting is not yet used.</%text>
+# git_hook_interpreter = /srv/kallithea/venv/bin/python2
+%if git_hook_interpreter:
+git_hook_interpreter = ${git_hook_interpreter}
+%endif
+
 <%text>## path to git executable</%text>
 git_path = git
 


More information about the kallithea-general mailing list