mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 18:54: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,
|
default=True,
|
||||||
help="Enable/disable looking for a git repo (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(
|
git_group.add_argument(
|
||||||
"--auto-commits",
|
"--auto-commits",
|
||||||
action=argparse.BooleanOptionalAction,
|
action=argparse.BooleanOptionalAction,
|
||||||
|
@ -429,6 +435,7 @@ def main(argv=None, input=None, output=None, force_git_root=None):
|
||||||
|
|
||||||
if args.git:
|
if args.git:
|
||||||
git_root = setup_git(git_root, io)
|
git_root = setup_git(git_root, io)
|
||||||
|
if args.gitignore:
|
||||||
check_gitignore(git_root, io)
|
check_gitignore(git_root, io)
|
||||||
|
|
||||||
def scrub_sensitive_info(text):
|
def scrub_sensitive_info(text):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue