mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
Add support to identify aider-written commits by checking the commit message
This commit is contained in:
parent
7508b8c93c
commit
133bb0491e
1 changed files with 3 additions and 3 deletions
|
@ -60,6 +60,9 @@ 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:"):
|
||||
author += " (aider)"
|
||||
commit_to_author[commit] = author
|
||||
return commit_to_author
|
||||
|
||||
|
@ -107,9 +110,6 @@ def get_counts_for_file(start_tag, end_tag, authors, fname):
|
|||
continue
|
||||
hsh = line[:hash_len]
|
||||
author = authors.get(hsh, "Unknown")
|
||||
# Normalize author names with "(aider)" to a single format
|
||||
if "(aider)" in author.lower():
|
||||
author = re.sub(r'\s*\(aider\)', ' (aider)', author, flags=re.IGNORECASE)
|
||||
line_counts[author] += 1
|
||||
|
||||
return dict(line_counts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue