From a4694511a0ed1f25d5bb35e9f10024672f788af9 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 24 May 2024 09:43:31 -0700 Subject: [PATCH] Updated get_lines_with_commit_hash to set verbose parameter to False, added show_commit_stats function, and called show_commit_stats in process_fnames. --- scripts/blame.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/blame.py b/scripts/blame.py index 1d82f59d7..a23662c41 100755 --- a/scripts/blame.py +++ b/scripts/blame.py @@ -8,7 +8,7 @@ import pylab as plt from aider.dump import dump from imgcat import imgcat -def get_lines_with_commit_hash(filename, aider_commits, git_dname, verbose=True): +def get_lines_with_commit_hash(filename, aider_commits, git_dname, verbose=False): result = subprocess.run( ["git", "-C", git_dname, "blame", "-l", filename], capture_output=True, @@ -58,15 +58,23 @@ def get_aider_commits(git_dname): commits.add(commit_hash) dump(len(commits)) + + return commits +def show_commit_stats(commits): + # TODO: print out the number of lines added and deleted for each commit + # report totals + pass def process_fnames(fnames, git_dname): if not git_dname: git_dname = "." aider_commits = get_aider_commits(git_dname) + show_commit_stats(aider_commits) + total_lines = 0 total_aider_lines = 0 @@ -159,8 +167,7 @@ def history(): def main(): - #history() - #return + #return history() if len(sys.argv) < 2: return process_repo()