From 13b95111ceb542d9617c4f1a7f44dfde691ed226 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 27 Nov 2018 22:27:09 +0300 Subject: [PATCH] Feat(set-commit-date.py): chdir to git root Necessary because `git --log --name-only` produces paths relative to the root. --- set-commit-date.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/set-commit-date.py b/set-commit-date.py index 71594ae..7f481f3 100755 --- a/set-commit-date.py +++ b/set-commit-date.py @@ -8,6 +8,10 @@ import os import subprocess +git_root = subprocess.check_output(['git', 'rev-parse', '--show-toplevel'], + universal_newlines=True).rstrip('\n') +os.chdir(git_root) + separator = '----- GIT LOG SEPARATOR -----' git_log = subprocess.Popen(['git', 'log', '-m', '--first-parent', -- 2.39.5