mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 08:14:59 +00:00
aider: Set default values for input and chat history files to be in the git root directory if there is one, otherwise, use the current directory.
# Context: USER: have the input and chat history files default to be located in the git root, if there is one ASSISTANT: To change the default location of the input and chat history files to the git root, you need to modify the `aider/main.py` file. Update the default values for `--input-history-file` and `--chat-history-file` arguments. Here's the change: ```python aider/main.py <<<<<<< ORIGINAL parser.add_argument( "--input-history-file", metavar="INPUT_HISTORY_FILE", env_var=f"{env_prefix}INPUT_HISTORY_FILE", default=".aider.input.history", help="Specify the chat input history file (default: .aider.input.history)", ) parser.add_argument( "--chat-history-file", metavar="CHAT_HISTORY_FILE", env_var=f"{env_prefix}CHAT_HISTORY_FILE", default=".aider.chat.history.md", help="Specify the chat history file (default: .aider.chat.history.md)", ) ======= default_input_history_file = os.path.join(git_root, ".aider.input.history") if git_root else ".aider.input.history" default_chat_history_file = os.path.join(git_root, ".aider.chat.history.md") if git_root else ".aider.chat.history.md" parser.add_argument( "--input-history-file", metavar="INPUT_HISTORY_FILE", env_var=f"{env_prefix}INPUT_HISTORY_FILE", default=default_input_history_file, help=f"Specify the chat input history file (default: {default_input_history_file})", ) parser.add_argument( "--chat-history-file", metavar="CHAT_HISTORY_FILE", env_var=f"{env_prefix}CHAT_HISTORY_FILE", default=default_chat_history_file, help=f"Specify the chat history file (default: {default_chat_history_file})", ) >>>>>>> UPDATED ``` This change sets the default values for the input and chat history files to be in the git root directory if there is one, otherwise, it will use the current directory.
This commit is contained in:
parent
e4116007b8
commit
ddc97dacf8
1 changed files with 7 additions and 4 deletions
|
@ -41,19 +41,22 @@ def main(args=None, input=None, output=None):
|
|||
nargs="*",
|
||||
help="a list of source code files (optional)",
|
||||
)
|
||||
default_input_history_file = os.path.join(git_root, ".aider.input.history") if git_root else ".aider.input.history"
|
||||
default_chat_history_file = os.path.join(git_root, ".aider.chat.history.md") if git_root else ".aider.chat.history.md"
|
||||
|
||||
parser.add_argument(
|
||||
"--input-history-file",
|
||||
metavar="INPUT_HISTORY_FILE",
|
||||
env_var=f"{env_prefix}INPUT_HISTORY_FILE",
|
||||
default=".aider.input.history",
|
||||
help="Specify the chat input history file (default: .aider.input.history)",
|
||||
default=default_input_history_file,
|
||||
help=f"Specify the chat input history file (default: {default_input_history_file})",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--chat-history-file",
|
||||
metavar="CHAT_HISTORY_FILE",
|
||||
env_var=f"{env_prefix}CHAT_HISTORY_FILE",
|
||||
default=".aider.chat.history.md",
|
||||
help="Specify the chat history file (default: .aider.chat.history.md)",
|
||||
default=default_chat_history_file,
|
||||
help=f"Specify the chat history file (default: {default_chat_history_file})",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--model",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue