mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 08:14:59 +00:00
![]() # Aider chat conversation: USER: do the todp ASSISTANT: To implement the TODO, we need to modify the `show_commit_stats` function to print out the number of lines added and deleted for each commit and report the totals. Here are the *SEARCH/REPLACE* blocks: scripts/blame.py ```python <<<<<<< SEARCH # TODO: print out the number of lines added and deleted for each commit # report totals pass ======= total_added_lines = 0 total_deleted_lines = 0 for commit in commits: result = subprocess.run( ["git", "show", "--stat", "--oneline", commit], capture_output=True, text=True, check=True ) added_lines = 0 deleted_lines = 0 for line in result.stdout.splitlines(): if "insertion" in line: added_lines += int(line.split()[0]) if "deletion" in line: deleted_lines += int(line.split()[0]) total_added_lines += added_lines total_deleted_lines += deleted_lines print(f"Commit {commit}: +{added_lines} -{deleted_lines}") print(f"Total: +{total_added_lines} -{total_deleted_lines}") >>>>>>> REPLACE ``` |
||
---|---|---|
.. | ||
blame.py | ||
Dockerfile.jekyll | ||
jekyll_build.sh | ||
jekyll_run.sh | ||
versionbump.py |