diff --git a/update-authors.py b/update-authors.py index dfeab0dcd..30c03ae40 100755 --- a/update-authors.py +++ b/update-authors.py @@ -5,7 +5,10 @@ author_re = re.compile(r'(?<=\t).*') -git_log = subprocess.check_output(['git', 'shortlog', '--summary', '--email']) +# Without the HEAD argument, git shortlog will fail when run during a pre-commit hook. +# Thanks to Michał Górny (https://stackoverflow.com/users/165333/micha%c5%82-g%c3%b3rny) +# for pointing this out: +git_log = subprocess.check_output(['git', 'shortlog', '--summary', '--email', 'HEAD']) log_entries = git_log.decode('utf-8').strip().split('\n')