From: Oleg Broytman Date: Tue, 27 Nov 2018 19:27:09 +0000 (+0300) Subject: Feat(set-commit-date.py): chdir to git root X-Git-Url: https://git.phdru.name/?p=git-scripts.git;a=commitdiff_plain;h=13b95111ceb542d9617c4f1a7f44dfde691ed226 Feat(set-commit-date.py): chdir to git root Necessary because `git --log --name-only` produces paths relative to the root. --- 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',