From f3cca9037b38816aa589a0b03cef10a8093ced66 Mon Sep 17 00:00:00 2001 From: ggman12 Date: Sun, 1 Feb 2026 23:40:57 -0500 Subject: [PATCH] adjust --since date to one day earlier for accurate commit range --- src/get_historical_faa.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/get_historical_faa.py b/src/get_historical_faa.py index d1aaaea..51cdcd4 100644 --- a/src/get_historical_faa.py +++ b/src/get_historical_faa.py @@ -15,6 +15,7 @@ from derive_from_faa_master_txt import convert_faa_master_txt_to_df, concat_faa_ import zipfile import pandas as pd import argparse +from datetime import datetime, timedelta # Parse command line arguments parser = argparse.ArgumentParser(description="Process historical FAA data from git commits") @@ -33,12 +34,16 @@ def run_git_text(*args: str) -> str: def run_git_bytes(*args: str) -> bytes: return subprocess.check_output(["git", "-C", str(REPO), *args]) +# Parse dates and adjust --since to the day before +since_date = datetime.strptime(args.since, "%Y-%m-%d") +adjusted_since = (since_date - timedelta(days=1)).strftime("%Y-%m-%d") + # All commits in specified date range (oldest -> newest) log = run_git_text( "log", "--reverse", "--format=%H %cs", - f"--since={args.since}", + f"--since={adjusted_since}", f"--until={args.until}", ) lines = [ln for ln in log.splitlines() if ln.strip()]