# HG changeset patch # User Mads Kiilerich # Date 1610368163 -3600 # Node ID fff835606650aed67721548236c184d1fc6ff394 # Parent ff58aa21f9a32d2be915f71225a2f72c955bc588 hooks: improve hook installation logging diff -r ff58aa21f9a3 -r fff835606650 kallithea/model/scm.py --- a/kallithea/model/scm.py Sun Jan 10 01:05:32 2021 +0100 +++ b/kallithea/model/scm.py Mon Jan 11 13:29:23 2021 +0100 @@ -682,12 +682,12 @@ for h_type, tmpl in [('pre-receive', tmpl_pre), ('post-receive', tmpl_post)]: hook_file = os.path.join(hooks_path, h_type) other_hook = False - log.debug('Installing git hook in repo %s', repo) + log.debug('Installing git hook %s in repo %s', h_type, repo.path) if os.path.islink(hook_file): log.debug("Found symlink hook at %s", hook_file) other_hook = True elif os.path.isfile(hook_file): - log.debug('hook exists, checking if it is from kallithea') + log.debug('hook file %s exists, checking if it is from kallithea', hook_file) with open(hook_file, 'rb') as f: data = f.read() matches = re.search(br'^KALLITHEA_HOOK_VER\s*=\s*(.*)$', data, flags=re.MULTILINE) @@ -703,7 +703,7 @@ if other_hook and not force: log.warning('skipping overwriting hook file %s', hook_file) else: - log.debug('writing %s hook file !', h_type) + log.debug('writing hook file %s', hook_file) try: fh, fn = tempfile.mkstemp(prefix=hook_file + '.tmp.') os.write(fh, tmpl.replace(b'_TMPL_', safe_bytes(kallithea.__version__)))