From 3e9873cc11783d6b23c03e6579e88cfe176bb819 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 24 May 2024 09:04:50 -0700 Subject: [PATCH] Update git commands in blame.py to accept a git directory name as an argument. --- scripts/blame.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/blame.py b/scripts/blame.py index 3557d3813..673aa5ff9 100755 --- a/scripts/blame.py +++ b/scripts/blame.py @@ -5,9 +5,9 @@ import subprocess from pathlib import Path from aider.dump import dump -def get_lines_with_commit_hash(filename, aider_commits, verbose=False): +def get_lines_with_commit_hash(filename, aider_commits, git_dname, verbose=False): result = subprocess.run( - ["git", "blame", "-l", filename], + ["git", "-C", git_dname, "blame", "-l", filename], capture_output=True, text=True, check=True @@ -35,11 +35,11 @@ def get_lines_with_commit_hash(filename, aider_commits, verbose=False): return num_lines, num_aider_lines -def get_aider_commits(): +def get_aider_commits(git_dname): """Get commit hashes for commits with messages starting with 'aider:'""" commits = set() result = subprocess.run( - ["git", "log", "--pretty=format:%H %s"], + ["git", "-C", git_dname, "log", "--pretty=format:%H %s"], capture_output=True, text=True, check=True