mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
Removed unused functions and simplified the script to only print the commit hashes for 'aider:' commits.
This commit is contained in:
parent
eb1b056792
commit
f7af56c53c
1 changed files with 3 additions and 25 deletions
|
@ -11,37 +11,15 @@ def get_aider_commits():
|
||||||
text=True,
|
text=True,
|
||||||
check=True
|
check=True
|
||||||
)
|
)
|
||||||
commits = []
|
|
||||||
for line in result.stdout.splitlines():
|
for line in result.stdout.splitlines():
|
||||||
print(line)
|
print(line)
|
||||||
commit_hash, commit_message = line.split(" ", 1)
|
commit_hash, commit_message = line.split(" ", 1)
|
||||||
if commit_message.startswith("aider:"):
|
if commit_message.startswith("aider:"):
|
||||||
commits.append(commit_hash)
|
commits.append(commit_hash)
|
||||||
|
|
||||||
dump(commits)
|
|
||||||
return commits
|
return commits
|
||||||
|
|
||||||
def get_blame_lines(commit_hash):
|
|
||||||
"""Get lines introduced by a specific commit"""
|
|
||||||
result = subprocess.run(
|
|
||||||
["git", "blame", "--line-porcelain", commit_hash],
|
|
||||||
capture_output=True,
|
|
||||||
text=True,
|
|
||||||
check=True
|
|
||||||
)
|
|
||||||
lines = []
|
|
||||||
for line in result.stdout.splitlines():
|
|
||||||
if line.startswith("author "):
|
|
||||||
lines.append(line)
|
|
||||||
return lines
|
|
||||||
|
|
||||||
def mark_aider_lines():
|
|
||||||
"""Mark lines introduced by 'aider:' commits"""
|
|
||||||
aider_commits = get_aider_commits()
|
|
||||||
for commit in aider_commits:
|
|
||||||
blame_lines = get_blame_lines(commit)
|
|
||||||
for line in blame_lines:
|
|
||||||
print(f"AIDER: {line}")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
mark_aider_lines()
|
mark_aider_lines(sys.argv[1])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue