mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
aider: Added commit message to cmd_add
method to indicate that the file was created and added by the aider.
# Context: USER: also commit the add with a suitable message ASSISTANT: To commit the added file with a suitable message, we will modify the `cmd_add` method in the `aider/commands.py` file. After adding the file to git, we will commit it with a message indicating that the file was created and added by the aider. Here are the changes to the `aider/commands.py` file: ```python aider/commands.py <<<<<<< ORIGINAL if self.coder.repo is not None: self.coder.repo.git.add(os.path.join(self.coder.root, word)) ======= if self.coder.repo is not None: self.coder.repo.git.add(os.path.join(self.coder.root, word)) commit_message = f"aider: Created and added {word} to git." self.coder.repo.git.commit("-m", commit_message, "--no-verify") >>>>>>> UPDATED ``` These changes commit the added file with a message indicating that the file was created and added by the aider.
This commit is contained in:
parent
c6d388595d
commit
296053a8d7
1 changed files with 2 additions and 0 deletions
|
@ -161,6 +161,8 @@ class Commands:
|
||||||
matched_files = [word]
|
matched_files = [word]
|
||||||
if self.coder.repo is not None:
|
if self.coder.repo is not None:
|
||||||
self.coder.repo.git.add(os.path.join(self.coder.root, word))
|
self.coder.repo.git.add(os.path.join(self.coder.root, word))
|
||||||
|
commit_message = f"aider: Created and added {word} to git."
|
||||||
|
self.coder.repo.git.commit("-m", commit_message, "--no-verify")
|
||||||
else:
|
else:
|
||||||
self.console.print(f"[red]No files matched '{word}'")
|
self.console.print(f"[red]No files matched '{word}'")
|
||||||
for matched_file in matched_files:
|
for matched_file in matched_files:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue