-
-
Notifications
You must be signed in to change notification settings - Fork 816
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
Add --ignore-file
flag
#156
Comments
Thank you for the feedback.
If I understand correctly, Have you seen > fd --exclude '*.o' --exclude '/etc/secret-files' ... Would this work for you?
If you don't expect them to be picked up, you can use the |
I think I may not have explained this clearly. Say I have an ignore file at If I run
|
This is actually the behaviour I expect. If I am in a git repository I would expect fd to behave similar to As @sharkdp mentioned the --include-file option in rg doesn't behave the way you describe. It adds ignore rules in addition to the ignore rules from .ignore and .gitignore files. |
I'm not in a git repo though. Hmm, I'll test something when I get in to
work tomorrow
On Wed, Nov 1, 2017 at 9:49 PM Thayne McCombs ***@***.***> wrote:
But fd seems to pick up every ignore file in the tree rather than jus the
top level one, which is unexpected behavior (for me at least)
This is actually the behaviour I expect. If I am in a git repository I
would expect fd to behave similar to git ls-files | grep. Usually, if I
don't want to include files that are ignored by .gitignore files in their
repository.
As @sharkdp <https://github.com/sharkdp> mentioned the --include-file
option in rg doesn't behave the way you describe. It adds ignore rules *in
addition to* the ignore rules from .ignore and .gitignore files.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#156 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AH8KTOCyxGHGFCsOikyXt-MiLlMwdc9nks5syUn0gaJpZM4QMFAH>
.
--
- Alok
|
My bad, its behavior is identical to |
I'd like to chime in in support of a command line option like this. I'm currently using fzf to quick-find files in vim, supported by While I certainly wouldn't want |
fd does that, too.
Okay, so you would really like to have the |
So it does! My mistake. I think the bigger issue then is simply that it's not mentioned in the man page or the README.
Thanks; it'd definitely be nice to be able to rely on predefined ignore files to specify large sets of non-default ignore patterns. |
After some more experimentation, it appears that IMHO it would be saner to honor On a separate note, the manpage also contains an error (it says to use (If it would save you some trouble, I'd be happy to amend the documentation myself to clarify this point once I have a clear understand of how things work, and once they work the way you intend.) |
This is due to our usage of the However, if my research is correct, the However, you have a fair point, since users might very well want to ignore different files for fd as compared to rg/ag. If
Thanks, fixed!
That would be great! Any contributions are always very much appreciated. |
Yep, this is definitely true. From @BurntSushi himself:
I can't say to a certainty what As to how fd should handle this problem, I think the question should really be, how much deviation from But you're the boss here, so what do you think? |
I'd just like to chime in and say that I'd support simple changes to the |
Agreed. Let's change this. So there are a few action points here:
|
Currently the fd man page says
The description is wrong since it also ignores the It would be useful to have an option |
I gave this a try but I think it's hard to get right without modifying the hardcoded My attempt was to add I think making the names of the default ignore files (currently |
@ptzz Please see the latter half of this comment: BurntSushi/ripgrep#673 (comment) TL;DR - While I believe that making |
@BurntSushi That sounds like a great approach! Btw., when trying the workarounds above I failed to find a way to respect only the additional ignore file. Using
Did not work. But with |
If that's true that sounds like a bug to me.
…On Nov 28, 2017 2:00 AM, "ptzz" ***@***.***> wrote:
@BurntSushi <https://github.com/burntsushi> That sounds like a great
approach!
Btw., when trying the workarounds above I failed to find a way to respect
*only* the additional ignore file. Using
ignore(false)
git_ignore(false)
add_ignore(<fdignore_abspath>)
Did not work. But with git_ignore(true), fdignore was also respected. I
did however not investigate why due the other reasons this approach would
not work. Maybe it’s expected behavior?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#156 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAb34tHZqFBwcZyGWkzMpQG019DyQ43eks5s669-gaJpZM4QMFAH>
.
|
This commit adds support for ignore files with custom names. This allows for application specific ignorefile names, e.g. using `.fdignore` for `fd`. See also: #673 See also: sharkdp/fd#156
Thanks to @ptzz's hard work, BurntSushi/ripgrep#706 got merged which will be in the next release of |
ignore-0.4.0 has been released (thanks!), but it's currently not possible to implement this due to BurntSushi/ripgrep#800 |
Added support for |
We now have:
All this has been documented and we have integration tests. I currently don't see any need for the additional |
@sharkdp I have a similar setup. With support for I.e. by default I want |
@ptzz I see. That's a valid use case... a I'm reopening this ticket to track the addition of |
Implemented in #271 |
Both |
Just as feedback, I miss having a shared Maybe someday there could be a configuration file that adds the old behavior as an option... |
@mbrubeck Oh, does |
It does not, anymore. We removed it (and added If I got this wrong or if there is a strong support for adding |
Right. You could achieve this by putting I think I thought the idea was that The downside I can see is that if someone did treat |
If this is the idea, I'm all for it! My previous understanding was that
I'm okay with this. We can add a detailed explanation of how |
I also thought If |
Let's add back support for |
Support for |
Basically identical to
rg
's same flag.The benefit of this is that sometimes you don't want to ignore every gitignore file found in the search path, but you do want to specifically ignore some files, so this flag comes in handy. Also, if I'm searching from
~
, I don't expect the gitignore file several levels down in some project to get picked up by default.The text was updated successfully, but these errors were encountered: