From 3929127d65ddc5d676862e9a514c26b655221900 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 28 Apr 2018 00:41:01 +0300 Subject: [PATCH] Refactor(set-commit-date.py): Use git_log.stdout as an iterator --- set-commit-date.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 -- 2.39.5