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.

This commit is contained in:
Paul Gauthier 2024-05-24 09:43:31 -07:00
parent 26210cfe6b
commit a4694511a0

View file

@ -8,7 +8,7 @@ import pylab as plt
from aider.dump import dump from aider.dump import dump
from imgcat import imgcat 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( result = subprocess.run(
["git", "-C", git_dname, "blame", "-l", filename], ["git", "-C", git_dname, "blame", "-l", filename],
capture_output=True, capture_output=True,
@ -58,15 +58,23 @@ def get_aider_commits(git_dname):
commits.add(commit_hash) commits.add(commit_hash)
dump(len(commits)) dump(len(commits))
return 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): def process_fnames(fnames, git_dname):
if not git_dname: if not git_dname:
git_dname = "." git_dname = "."
aider_commits = get_aider_commits(git_dname) aider_commits = get_aider_commits(git_dname)
show_commit_stats(aider_commits)
total_lines = 0 total_lines = 0
total_aider_lines = 0 total_aider_lines = 0
@ -159,8 +167,7 @@ def history():
def main(): def main():
#history() #return history()
#return
if len(sys.argv) < 2: if len(sys.argv) < 2:
return process_repo() return process_repo()