fix: ganti --after/--before ke --since/--until dengan waktu eksplisit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
sas.fajri
2026-05-28 16:59:59 +07:00
parent f27a8abf70
commit 2bd1771c2b
3 changed files with 7 additions and 11 deletions

View File

@@ -23,8 +23,8 @@ def get_commits(repo_path: str, author: str, since: str, until: str) -> list[dic
"git", "-C", repo_path,
"log",
f"--author={author}",
f"--after={since}",
f"--before={until}",
f"--since={since} 00:00:00",
f"--until={until} 23:59:59",
"--format=%h|%ad|%s",
"--date=short",
]
@@ -53,16 +53,13 @@ def main():
parser.add_argument("--until", default=today, help=f"Tanggal akhir YYYY-MM-DD (default: hari ini {today})")
args = parser.parse_args()
# --until perlu +1 hari karena git --before bersifat eksklusif
until_exclusive = (date.fromisoformat(args.until) + timedelta(days=1)).isoformat()
print(f"Author : {args.author}")
print(f"Periode: {args.since} s/d {args.until}")
print("=" * 60)
grouped = defaultdict(list)
for repo in REPOS:
commits = get_commits(repo["path"], args.author, args.since, until_exclusive)
commits = get_commits(repo["path"], args.author, args.since, args.until)
repo_name = repo["path"].split("/")[-1]
for c in commits:
grouped[repo["project"]].append({**c, "repo": repo_name})