feat: blame: Detect aider commits using co-authored-by

Co-authored-by: aider (gpt-5) <aider@aider.chat>
This commit is contained in:
Paul Gauthier
2025-08-09 09:55:52 -03:00
parent 071d177309
commit f57c0f624a

View File

@@ -89,8 +89,13 @@ def get_commit_authors(commits):
commit_to_author = dict()
for commit in commits:
author = run(["git", "show", "-s", "--format=%an", commit]).strip()
commit_message = run(["git", "show", "-s", "--format=%s", commit]).strip()
if commit_message.lower().startswith("aider:"):
subject = run(["git", "show", "-s", "--format=%s", commit]).strip()
full_message = run(["git", "show", "-s", "--format=%B", commit]).strip()
lower_subject = subject.lower()
lower_full = full_message.lower()
if lower_subject.startswith("aider:") or "co-authored-by: aider" in lower_full:
author += " (aider)"
commit_to_author[commit] = author
return commit_to_author