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

Double-star in ignore glob patterns does not work #530

Open
tremby opened this issue Nov 21, 2014 · 15 comments
Open

Double-star in ignore glob patterns does not work #530

tremby opened this issue Nov 21, 2014 · 15 comments
Labels

Comments

@tremby
Copy link

@tremby tremby commented Nov 21, 2014

I have a rule /public/**/*.js in my .gitignore file, which means ignore any file ending in .js which is in /public or any subdirectory of /public. Ag is still giving results from such files.

@ggreer ggreer added the ignore label Nov 23, 2014
@smathy

This comment has been minimized.

Copy link

@smathy smathy commented Nov 30, 2014

Same for me in 0.26

@ggreer

This comment has been minimized.

Copy link
Owner

@ggreer ggreer commented Dec 1, 2014

Yes, this requires some changes to the ignoring code to work correctly. I don't use double-stars in my gitignores, so I've kinda neglected it. Sorry. :(

Note: The "ignore" label is for issues with git/hg/ag-ignores. It doesn't mean I'm going to ignore the issue.

@smathy

This comment has been minimized.

Copy link

@smathy smathy commented Dec 1, 2014

😆 re the explanation of the ignore tag, thanks for the clarification :)

@jasonkarns

This comment has been minimized.

Copy link

@jasonkarns jasonkarns commented Mar 24, 2015

As noted in #594 (comment), this could be solved for git by using git status --ignored to get the ignore list rather than parsing .gitignore directly.

@decaff

This comment has been minimized.

Copy link

@decaff decaff commented Jun 23, 2015

I wired up Jason's suggestion, here. Not tested on Unix. Works for me on Windows.

@talha131

This comment has been minimized.

Copy link

@talha131 talha131 commented Sep 18, 2016

Any update on this issue?

@talha131

This comment has been minimized.

Copy link

@talha131 talha131 commented Sep 18, 2016

I have added note about this issue in the wiki.

@tremby

This comment has been minimized.

Copy link
Author

@tremby tremby commented Sep 18, 2016

I just use git grep instead of this package and no longer have to worry about things like this.

@lilyball

This comment has been minimized.

Copy link

@lilyball lilyball commented Oct 19, 2016

Are single asterisks not supported either? I'm trying a pattern like p/main/*/migrations and it's not actually ignoring anything.

@roblourens

This comment has been minimized.

Copy link

@roblourens roblourens commented Feb 7, 2017

I know this is an old issue, but is it likely to ever be fixed? If it might be fixable via PR, can you give a pointer to where in the code this pattern matching happens?

@gavenkoa

This comment has been minimized.

Copy link

@gavenkoa gavenkoa commented Feb 19, 2017

@kballard I reported bug: #1060

Adding leaning slash allows matches of path with asterisks...

For your case it is /p/main/*/migrations

@fabiospampinato

This comment has been minimized.

Copy link

@fabiospampinato fabiospampinato commented Aug 12, 2018

It would be nice if this got fixed. I was quite disappointed to discover that even though the readme says It ignores file patterns from your .gitignore and .hgignore. that's not really the case :/.

Reading @decaff's published fix this doesn't seem too hard to implement.

@ggreer would you consider a PR for this?

@fmcgough

This comment has been minimized.

Copy link

@fmcgough fmcgough commented Sep 6, 2018

This is making ag basically unusable for me, I use double-stars heavily in my .gitignore files. It seems to be a regression since (at least) version 0.31, as I discovered when upgrading to ubuntu 18.04 from 16.04. And as @fabiospampinato mentioned, it's misleading and frustrating to find that the readme is incorrect.

@talha131

This comment has been minimized.

Copy link

@talha131 talha131 commented Sep 6, 2018

@fmcgough There is an alternate RipGrep which does not have this bug. Like me, you may want to migrate to it.

@cmdcolin

This comment has been minimized.

Copy link

@cmdcolin cmdcolin commented May 16, 2019

Would definitely like this :) big fan of ag, my hands are trained on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.