The GitRepo class in the aider/repo.py file has been updated to support a new `commit_prompt` argument. This allows overriding the default `prompts.commit_system` when generating commit messages.
The changes include:
1. Adding the `commit_prompt` parameter to the `__init__` method of the `GitRepo` class.
2. Storing the `commit_prompt` value in the `self.commit_prompt` attribute.
3. Modifying the `get_commit_message` method to use the `self.commit_prompt` value if it's provided, otherwise falling back to the default `prompts.commit_system`.
This change provides more flexibility in customizing the commit message generation process, allowing users to provide their own custom prompts if needed.
# Aider chat conversation:
USER: I ran this command:
pre-commit run --files aider/repo.py
And got this output:
isort....................................................................Passed
black....................................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
aider/repo.py:247:101: E501 line too long (111 > 100 characters)
"""
Returns a list of all files which are dirty (not committed), either staged or in the working directory.
"""
^
ASSISTANT: Please add the file `aider/repo.py` to the chat so I can make the necessary changes.
USER: I added these files to the chat: aider/repo.py
ASSISTANT: To fix the flake8 error, we need to shorten the docstring to comply with the line length limit of 100 characters.
Here is the *SEARCH/REPLACE* block:
aider/repo.py
```python
<<<<<<< SEARCH
"""
Returns a list of all files which are dirty (not committed), either staged or in the working directory.
"""
=======
"""
Returns a list of all files which are dirty (not committed), either staged or in the working
directory.
"""
>>>>>>> REPLACE
```