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

Prefer .ignore to .agignore. #974

Merged
merged 4 commits into from
Sep 24, 2016
Merged

Prefer .ignore to .agignore. #974

merged 4 commits into from
Sep 24, 2016

Conversation

ggreer
Copy link
Owner

@ggreer ggreer commented Sep 24, 2016

Thanks to discussion on https://news.ycombinator.com/item?id=12564442, @BurntSushi and I agreed on a common file name for ignore patterns. He's made his PR for ripgrep. This is ag's counterpart.

To those who worry about change: Please don't! It will be a long time before .agignore is no longer obeyed, if ever.

@ggreer ggreer merged commit c41ce6c into master Sep 24, 2016
BurntSushi added a commit to BurntSushi/ripgrep that referenced this pull request Sep 24, 2016
But don't actually remove support for .rgignore until the next semver
bump.

Note that this puts us in line with the silver searcher:
ggreer/the_silver_searcher#974

Fixes #40
amsharma91 added a commit to amsharma91/ripgrep that referenced this pull request Sep 27, 2016
But don't actually remove support for .rgignore until the next semver
bump.

Note that this puts us in line with the silver searcher:
ggreer/the_silver_searcher#974

Fixes BurntSushi#40
@@ -195,13 +195,13 @@ run `ag --list-file-types`.
## IGNORING FILES

By default, ag will ignore files whose names match patterns in .gitignore,
.hgignore, or .agignore. These files can be anywhere in the directories being
.hgignore, or .ignore. These files can be anywhere in the directories being
searched. Ag also ignores files matched by the svn:ignore property if `svn
--version` is 1.6 or older. Finally, ag looks in $HOME/.agignore for ignore

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally, ag looks in $HOME/.agignore

Shouldn't it now say $HOME/.ignore?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like ag 1.0.3 doesn't take ~/.ignore into account at all (still ignoring patterns from ~/.agignore).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little late, but it may be useful for someone else until #1084 is done: according to the wiki

consider adding this alias: alias ag='ag --path-to-ignore ~/.ignore'

@jonathanjouty
Copy link

Good work on agreeing to commonly use .ignore! Only just caught up with this on HackerNews, so sorry for being late to the game...

I have a minor quibble...
As you're keeping support for .agignore, you should mention in the documentation that this is still part of current behaviour, and will be discontinued on some future release.

I imagine some poor soul git cloneing a repository with a .agignore, breaking their head over why they can't ag what they are looking for...

Also relevant for BurntSushi/ripgrep#41

@davidosomething
Copy link

In case anyone needs clarification:

  • CURRENTDIR or PARENTDIRS/.ignore is the local ignore file
  • ~/.agignore is global and included in every search, pretty much appended to the bottom of your local .ignore

casimir referenced this pull request in alacritty/alacritty Jan 10, 2017
Searching on the ref tests would find matches in the terminal recording
files and completely screw up the screen state.
@rafi
Copy link

rafi commented Feb 16, 2017

It would be great if ag could search for it in ~/.config/ag/ignore also.

backus added a commit to backus/clarity that referenced this pull request Jul 5, 2017
Ag and ripgrep both respect .ignore. See ggreer/the_silver_searcher#974
devonzuegel pushed a commit to devonzuegel/clarity that referenced this pull request Jul 18, 2017
Ag and ripgrep both respect .ignore. See ggreer/the_silver_searcher#974
michaelherold added a commit to michaelherold/dotfiles that referenced this pull request Dec 7, 2021
This has been supported for five years. I don't know why I didn't
realize that.

[1]: ggreer/the_silver_searcher#974
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

Successfully merging this pull request may close these issues.

None yet

6 participants