diff --git a/scripts/blame.py b/scripts/blame.py index ee98ec99e..cebfb4240 100755 --- a/scripts/blame.py +++ b/scripts/blame.py @@ -11,37 +11,15 @@ def get_aider_commits(): text=True, check=True ) - commits = [] + for line in result.stdout.splitlines(): print(line) commit_hash, commit_message = line.split(" ", 1) if commit_message.startswith("aider:"): commits.append(commit_hash) - dump(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__": - mark_aider_lines() + mark_aider_lines(sys.argv[1])