aider/scripts
Paul Gauthier fb717b8786 aider: Refactored show_commit_stats to print out lines added and deleted for each commit and report totals.
# 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
```
2024-05-24 09:43:33 -07:00
..
blame.py aider: Refactored show_commit_stats to print out lines added and deleted for each commit and report totals. 2024-05-24 09:43:33 -07:00
Dockerfile.jekyll moved 2024-05-15 11:00:18 -07:00
jekyll_build.sh renamed dockerfile 2024-05-15 11:29:34 -07:00
jekyll_run.sh moved 2024-05-15 11:00:18 -07:00
versionbump.py aider: Add logic to compare commit dates of main and origin/main and print a message explaining which one is behind. 2023-11-17 15:50:37 -08:00