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

Inverse of .ignore file (like .include) or explicit include support in .ignore file #1542

Open
etosan opened this issue Oct 9, 2024 · 3 comments

Comments

@etosan
Copy link

etosan commented Oct 9, 2024

ag and some other tools support .ignore file, where one can exclude searching in specific files and directories that are of no interest.

Unfortunately in some projects, like for example gitea managed ones, there are hidden dirs like .gitea that one would like ag to search through anyway, by default, especially when dealing with IaC monorepos and similar (as action workflows live there etc).

It would be great, if one could have explicit inclusions for such dirs defined in .ignore-file for exemaple by following .gitignore's !something pattern to explicitly include given path.

Would this be possible?

@thomasjm
Copy link

I was expecting this to work with "!" syntax and was surprised to find that it doesn't.

Seems like ripgrep supports it out of the box.

@etosan
Copy link
Author

etosan commented Jan 16, 2025

@thomasjm I am hitting this problem more and more recently, and it seems that development rate on ag has slowed down. Would you consider ripgrep sufficient replacement for ag feature wise?

Inability to negate exclusions is becoming show-stopper for me.

@thomasjm
Copy link

Well, ripgrep has almost twice the GitHub stars.

There are a lot of details comparing them in this blog post: https://burntsushi.net/ripgrep/

At this point I only use ag because the Emacs Helm integration is better than the ripgrep equivalent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants