From c26079e63317b0959dc3abb9f6a8dcad7656a3df Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 23 Jun 2023 14:01:55 -0700 Subject: [PATCH] aider: Added ability to exclude files with 'test' in the filename when adding files to the repo. # Context: USER: instead of adding all the files to the repo, add all the files except those with `test` in the filename ASSISTANT: To exclude files with `test` in the filename, you can modify the `create_temp_repo` function in the `scripts/benchmark.py` file. Here's the updated code: ```python scripts/benchmark.py <<<<<<< ORIGINAL # Add all copied files to the repo repo.git.add(A=True) ======= # Add all copied files to the repo, excluding those with 'test' in the filename for item in os.listdir(tempdir): if "test" not in item: repo.git.add(item) >>>>>>> UPDATED ``` This change will add files to the repository one by one, excluding those with `test` in the filename. --- scripts/benchmark.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/benchmark.py b/scripts/benchmark.py index f960c2ae1..69d289c9f 100644 --- a/scripts/benchmark.py +++ b/scripts/benchmark.py @@ -24,8 +24,10 @@ def create_temp_repo(dirname, tempdir): # Create a new git repo in tempdir repo = Repo.init(tempdir) - # Add all copied files to the repo - repo.git.add(A=True) + # Add all copied files to the repo, excluding those with 'test' in the filename + for item in os.listdir(tempdir): + if "test" not in item: + repo.git.add(item) # Commit with message "initial" repo.git.commit(m="initial")