From a61c9ae8a74e56a970c394b917d50058fc8fbb97 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Tue, 31 Dec 2024 20:29:15 +0500 Subject: [PATCH] Improve commits counting: inly count merge commits, calc between midnights UTC --- tagging/update_wiki.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tagging/update_wiki.py b/tagging/update_wiki.py index 597c38e4..69af5a47 100755 --- a/tagging/update_wiki.py +++ b/tagging/update_wiki.py @@ -34,10 +34,19 @@ def build_monthly_table_line(year_month_file: Path) -> str: year=int(year_month[:4]), month=int(year_month[5:]), day=1 ) next_month = current_month + relativedelta.relativedelta(months=1) - future = ( - git["log", "--oneline", "--since", current_month, "--until", next_month] - & plumbum.BG - ) + with plumbum.local.env(TZ="UTC"): + future = ( + git[ + "log", + "--oneline", + "--since", + f"{current_month}.midnight", + "--until", + f"{next_month}.midnight", + "--first-parent", + ] + & plumbum.BG + ) future.wait() commits = len(future.stdout.splitlines())