X-Git-Url: https://git.phdru.name/?p=git-scripts.git;a=blobdiff_plain;f=set-commit-date.py;h=71594ae3899e896a2d50901d7bf873178b7fdf0c;hp=dc6a5fb732d93a0499323e9197305797a24172d8;hb=3929127d65ddc5d676862e9a514c26b655221900;hpb=85d6f6f54e4730b4d68b8277e28f3b97701642d1 diff --git a/set-commit-date.py b/set-commit-date.py index dc6a5fb..71594ae 100755 --- a/set-commit-date.py +++ b/set-commit-date.py @@ -18,10 +18,7 @@ git_log = subprocess.Popen(['git', 'log', '-m', '--first-parent', filenames = set() # stages: 1 - start of commit, 2 - timestamp, 3 - empty line, 4 - files stage = 1 -while True: - line = git_log.stdout.readline() - if not line: # EOF - break +for line in git_log.stdout: line = line.strip() if (stage in (1, 4)) and (line == separator): # Start of a commit stage = 2