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:
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user