-
-
Notifications
You must be signed in to change notification settings - Fork 532
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
vcs.useIgnoreFile
ignores nested ignore files
#2312
Comments
This is a known limitation. I am unsure if this is properly documented. |
vcs.useIgnoreFile
ignores nested ignore filesvcs.useIgnoreFile
ignores nested ignore files
From what I see in the code, the contents from I checked the places where this function is called, and (for the relevant cases where this issue applies), we always have an available I think that we could apply the following strategy:
EDIT: Example. If we had a
and then another one at
The "merged" result would be as if the root
EDIT 2:
Nevermind, I see that the function returns a tuple, not just a rules vector. |
Well, it seems I was too optimistic. It is also necessary to replicate part of the logic inside of the
@Conaclos Do you think the approach I outlined makes sense? Or would it hurt performance too much because of the synchronous file traversal? (I'm not used to deal with highly optimised code, so I'm not entirely sure). |
I think @ematipico knows more about this. |
Because of the current approach, it isn't possible to perfectly coordinate and collect the information when we traverse the file system. We have been talking about refactoring the traversal to make it a bit different and make it more "synchronous" as you suggested. The first step might be to actually not spawning a process when traversing a folder. Instead, we should first pause and check for relevant files such as
Are you talking about |
Hi @ematipico , I'm sorry, I missed your response. I have a working branch with a lot of ugly code that illustrates what I was trying to do. I can create a draft PR, so it will be easier to discuss it. My approach has been to only look for the "relevant" nested |
To achieve this, we require #3307 |
Environment information
What happened?
vcs.useIgnoreFile
respects:/.gitignore
but not nested ignore files such as:/packages/foo/.gitignore
.Expected result
vcs.useIgnoreFile
should respect nested ignore files like Git does. They're helpful in monorepos.Code of Conduct
The text was updated successfully, but these errors were encountered: