Mercurial > kallithea
changeset 7634:6df08d78f8e7 stable
cli: fill in git_hook_interpreter at 'config-create' time to really fix potentially invalid interpreter in git hooks (Issue #333)
When generating a configuration file using 'kallithea-cli config-create', it is
probably using the right Python interpreter, so fill in the current Python
executable as 'git_hook_interpreter' in the generated file.
There should thus rarely be any need to configure this manually, and issue #333
will *really* be fixed.
As this causes an absolute path to be encoded inside the ini file, moving
the virtualenv will require updating this path.
For development.ini we do not want to hardcode any path and are happy to leave
it using the old heuristics at runtime.
Suggested-by: Mads Kiilerich <mads@kiilerich.com>
author | Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> |
---|---|
date | Mon, 08 Apr 2019 22:06:12 +0200 |
parents | 1bafb2d07709 |
children | b293ec74ef98 |
files | kallithea/bin/kallithea_cli_config.py |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/bin/kallithea_cli_config.py Mon Apr 08 21:32:57 2019 +0200 +++ b/kallithea/bin/kallithea_cli_config.py Mon Apr 08 22:06:12 2019 +0200 @@ -16,6 +16,7 @@ import kallithea.bin.kallithea_cli_base as cli_base import os +import sys import uuid from collections import defaultdict @@ -59,7 +60,9 @@ should go. """ - mako_variable_values = {} + mako_variable_values = { + 'git_hook_interpreter': sys.executable, + } ini_settings = defaultdict(dict) section_name = None