mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
aider: Add --gitignore/--no-gitignore switches (like the others) default is true, only call check_gitignore
if it's true.
# Aider chat conversation: USER: add --gitignore/--no-gitignore switches (like the others) default is true. only call `check_gitignore` if it's true. ASSISTANT: To add the `--gitignore/--no-gitignore` switches, we need to modify the `aider/main.py` file. Here are the steps: 1. Add a new argument to the `git_group` in the `main` function to handle the `--gitignore/--no-gitignore` switches. 2. Modify the `if args.git:` block to only call `check_gitignore` if `args.gitignore` is `True`. Here are the proposed changes: ```python aider/main.py <<<<<<< HEAD git_group = parser.add_argument_group("Git Settings") git_group.add_argument( "--git", action=argparse.BooleanOptionalAction, default=True, help="Enable/disable looking for a git repo (default: True)", ) git_group.add_argument( "--auto-commits", action=argparse.BooleanOptionalAction, default=True, help="Enable/disable auto commit of GPT changes (default: True)", ) git_group.add_argument( "--dirty-commits", action=argparse.BooleanOptionalAction, default=True, help="Enable/disable commits when repo is found dirty (default: True)", ) git_group.add_argument( "--dry-run", action=argparse.BooleanOptionalAction, default=False, help="Enable/disable performing a dry run without modifying files (default: False)", ) ======= git_group = parser.add_argument_group("Git Settings") git_group.add_argument( "--git", action=argparse.BooleanOptionalAction, default=True, help="Enable/disable looking for a git repo (default: True)", ) git_group.add_argument( "--gitignore", action=argparse.BooleanOptionalAction, default=True, help="Enable/disable adding .aider* to .gitignore (default: True)", ) git_group.add_argument( "--auto-commits", action=argparse.BooleanOptionalAction, default=True, help="Enable/disable auto commit of GPT changes (default: True)", ) git_group.add_argument( "--dirty-commits", action=argparse.BooleanOptionalAction, default=True, help="Enable/disable commits when repo is found dirty (default: True)", ) git_group.add_argument( "--dry-run", action=argparse.BooleanOptionalAction, default=False, help="Enable/disable performing a dry run without modifying files (default: False)", ) >>>>>>> updated ``` ```python aider/main.py <<<<<<< HEAD if args.git: git_root = setup_git(git_root, io) check_gitignore(git_root, io) ======= if args.git: git_root = setup_git(git_root, io) if args.gitignore: check_gitignore(git_root, io) >>>>>>> updated ```
This commit is contained in:
parent
6a7fd93580
commit
14eb12364d
1 changed files with 8 additions and 1 deletions
|
@ -292,6 +292,12 @@ def main(argv=None, input=None, output=None, force_git_root=None):
|
|||
default=True,
|
||||
help="Enable/disable looking for a git repo (default: True)",
|
||||
)
|
||||
git_group.add_argument(
|
||||
"--gitignore",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=True,
|
||||
help="Enable/disable adding .aider* to .gitignore (default: True)",
|
||||
)
|
||||
git_group.add_argument(
|
||||
"--auto-commits",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
|
@ -429,7 +435,8 @@ def main(argv=None, input=None, output=None, force_git_root=None):
|
|||
|
||||
if args.git:
|
||||
git_root = setup_git(git_root, io)
|
||||
check_gitignore(git_root, io)
|
||||
if args.gitignore:
|
||||
check_gitignore(git_root, io)
|
||||
|
||||
def scrub_sensitive_info(text):
|
||||
# Replace sensitive information with placeholder
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue