let aiderignore use info/exclude
Issue
aiderignore suggests to edit the project-wide gitignore to exlude .aider.* files; however not every user must use aider as it is not a build requirement. For personal setup, use .git/info/exclude instead
Version and model info
No response
Thank you for filing this issue.
If I understand your question/suggestion correctly, you do not want to have to put the .aider.* entry in every project .gitignore which you use aider for, correct?
You can create a global gitignore file (e.g. ~/.config/git/ignore and put
.aider.*
in it, then those files will get automatically ignored in every project, without the need to put this entry into every project.gitignore file, also aider will not bother you about this anymore.
It's just that it is bad practice to spam a common .gitignore files with your personal setup, like files produced by your IDE or command-line tools, and aider should rather facilitate best than bad practice. A global personal .gitignore is a work-around but I am still under the impression that .gitignore is rather for build artifacts.
Aider won't modify an existing .gitignore file without asking you first.
That's good, point is that even better would be asking about modifying info/exclude instead of .gitignore. Even if of all repo users agree on Aider being an indispensable build tool, it's still rather meant for build output artifacts.
Aider won't offer to modify .gitignore if you add .aider* to .git/info/exclude or to .gitignore_global.
That's good for those who got it right from the start, though the help entry for --gitignore read as if those who did not add them there would be led astray (by proposing an entry to .gitignore first by default).
For example, I start in aider in a new repo and it says
$ aider
Add .aider* to .gitignore (recommended)? (Y)es/(N)o [Yes]:
The point I was trying to make that this is not to be recommended.
Instead, I'd gladly add them to .git/info/exclude instead, if for matter of fact, it hadn't already happened as I added them there in the git template folder.
So my advice is to document this and let the user decide instead of aider pushing for it.
This issue has been labelled stale because it has been open for 2 weeks with no activity. Remove stale label or add a comment to keep this issue open. Otherwise, it will be closed in 7 days.
This issue was closed because it has been stalled for 3 weeks with no activity. Feel free to add a comment here and we can re-open it. Or feel free to file a new issue any time.
¯\(ツ)/¯
Aider won't offer to modify .gitignore if you add .aider* to .git/info/exclude or to .gitignore_global.
Hi @paul-gauthier
Looks like aider doesn't respect that.
Step1: When I run cat .git/info/exclude
The result is
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
# *aider*
.aider*
When running aider, it still asks for .aider* and .env to gitignore...
Just
## Enable/disable adding .aider* to .gitignore (default: True)
gitignore: false
as a new default would work for now
Aider looks to be sure that .aider* and .env are excluded. It honors any way that git supports such exclusions:
(aider) macbook:...tmp/new$ git init
(aider) macbook:...tmp/new$ echo '.aider*' > .git/info/exclude
(aider) macbook:...tmp/new$ echo '.env' >> .git/info/exclude
(aider) macbook:...tmp/new$ aider
──────────────────────────────────────────────────────────────────────────────────────────────────────────────
Aider v0.62.2.dev
Main model: claude-3-5-sonnet-20241022 with diff edit format, infinite output
Weak model: claude-3-5-haiku-20241022
Git repo: .git with 0 files
Repo-map: using 1024 tokens, auto refresh
Use /help <question> for help, run "aider --help" to see cmd line args
──────────────────────────────────────────────────────────────────────────────────────────────────────────────
>
Aider looks to be sure that
.aider*and.envare excluded. It honors any way that git supports such exclusions:(aider) macbook:...tmp/new$ git init (aider) macbook:...tmp/new$ echo '.aider*' > .git/info/exclude (aider) macbook:...tmp/new$ echo '.env' >> .git/info/exclude (aider) macbook:...tmp/new$ aider ────────────────────────────────────────────────────────────────────────────────────────────────────────────── Aider v0.62.2.dev Main model: claude-3-5-sonnet-20241022 with diff edit format, infinite output Weak model: claude-3-5-haiku-20241022 Git repo: .git with 0 files Repo-map: using 1024 tokens, auto refresh Use /help <question> for help, run "aider --help" to see cmd line args ────────────────────────────────────────────────────────────────────────────────────────────────────────────── >
Thanks for the work @paul-gauthier . I believe this is available in master branch build, in that case I will check it tomorrow (around 12 hours from now).
This should be working this way in the released version.
Aider looks to be sure that .aider* and .env are excluded. It honors any way that git supports such exclusions:
This is not true for me in aider 0.73.0.
> git status --ignored
On branch master
Your branch is up to date with 'origin/master'.
Ignored files:
(use "git add -f <file>..." to include in what will be committed)
.aider.chat.history.md
.aider.input.history
.aider.tags.cache.v3/
smu
smu.o
nothing to commit, working tree clean
> aider
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Add .aider* to .gitignore (recommended)? (Y)es/(N)o [Yes]:
I use a global gitignore, so at least https://github.com/Aider-AI/aider/issues/3072 is still open.