Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't display gitignore message when .aider* is in the global gitignore #3072

Closed
leighmcculloch opened this issue Jan 30, 2025 · 10 comments
Closed
Labels
bug Something isn't working fixed

Comments

@leighmcculloch
Copy link

Issue

When starting aider in a git repo that has no .gitignore, but the gitconfig has a global exclude file that already excludes aider files, it still asks to modify the current repo with .aider* gitignores.

In the gitconfig an excludes file can be specified as so:

core.excludesfile=~/.gitignore_global

If aider gitignores are in that file, it could skip prompting to modify the current project because effectively the person is already ignoring them.

Version and model info

aider 0.72.3

@karlb
Copy link

karlb commented Feb 2, 2025

It might be out of scope for aider, but it would also be nice if aider suggested a single global ignore rather than adding the ignore to every repo. See also https://sebastiandedeyne.com/setting-up-a-global-gitignore-file/. That would be a great multiplier for showing people the (IMO) right way.

@leighmcculloch
Copy link
Author

+1 The main reason I put aider's ignores into the global ignore instead of the repo ignore is because it's more to do with my own personal development environment and less to do with the project itself.

@bkudria
Copy link

bkudria commented Feb 4, 2025

I can second this, I'm trying aider at work on a shared repository that I shouldn't add arbitrary ignore rules to. Currently, aider shows me this prompt every time I start it.

@paul-gauthier
Copy link
Collaborator

Thanks for trying aider and filing this issue.

What do you have in your global ignore file? Aider checks for .aider* not .aider.* which is a common misunderstanding.

Also you can do --no-gitignore to skip this check.

@leighmcculloch
Copy link
Author

leighmcculloch commented Feb 4, 2025

This is my global gitignore file. It's got .aider* in it.

$ cat ~/.gitignore_global
*~
*.orig
*.rej
*.swp
.#*
*.o
.DS_Store
.devcontainer
.vscode
zig-cache
.idea
__debug_bin
.soroban/
.aider*

It's configured via ~/.gitconfig:

$ cat ~/.gitconfig
...
[core]
        excludesfile = ~/.gitignore_global
...

@github-actions github-actions bot added the question Further information is requested label Feb 4, 2025
@paul-gauthier
Copy link
Collaborator

The fix is available in the main branch. You can get it by installing the latest version from github:

aider --install-main-branch

# or...

python -m pip install --upgrade --upgrade-strategy only-if-needed git+https://github.com/Aider-AI/aider.git

If you have a chance to try it, let me know if it works better for you.

@paul-gauthier paul-gauthier added bug Something isn't working fixed and removed question Further information is requested labels Feb 4, 2025
@bkudria
Copy link

bkudria commented Feb 7, 2025

This isn't fixed for me. Note that my repository is ~, if that makes a difference.

❯ cat ~/.gitconfig | grep global
	excludesfile = /Users/bkudria/.gitignore_global

~ ─────────────────────────────────────────────────────── ▼
❯ cat ~/.gitignore_global | grep aider
.aider*

~ ─────────────────────────────────────────────────────── ▼
❯ cat ~/.gitignore | grep aider

~ ───────────────────────────────────────────────── ✘ 0|1 ▼
❯ aider --version
aider 0.74.1.dev3+g71ac7efa

~ ─────────────────────────────────────────────────────── ▼
❯ aider
──────────────────────────────────────────────────────────
You can skip this check with --no-gitignore
Add .aider* to .gitignore (recommended)? (Y)es/(N)o [Yes]:

@paul-gauthier
Copy link
Collaborator

What happens if you do this:

$ touch .aider.test ; git add .aider.test

The following paths are ignored by one of your .gitignore files:
.aider.test
hint: Use -f if you really want to add them.
hint: Disable this message with "git config advice.addIgnoredFile false"

@bkudria
Copy link

bkudria commented Feb 7, 2025

Oh, doh, you're right, I forgot that I !.* in my ~/.gitignore and that overrides the global 🤦. Sorry for the confusion, I can confirm the fix works in a fresh repo!

Copy link

I'm closing this bug report since it has been marked as 'fixed' for over 3 weeks. This issue should be resolved in recent versions of aider.

If you find that this bug is still present, please feel free to reopen this issue or create a new one with steps to reproduce.

Note: A bot script made these updates to the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

4 participants