-
Notifications
You must be signed in to change notification settings - Fork 149
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
Nested .gitignore breaks all ignores #578
Comments
It looks like the
Probably something needs to be done here instead:
|
Yep, this (bug and reason for it) is known, and the next priority. However, I don't have time at the moment to work on it. |
I don't mind working on this if you don't have time. If you have notes you want to share, or other pointers, I can begin fixing this. |
Ultimately I want to replace all ignore handling, but a good start is probably to fix this particular issue, which is to use (My current understanding is that a gitignorebuilder is for a single directory; I believe that if two files apply to a single directory they can be handled by one builder. However that might be too much complexity for too little gain.) |
When using
watchexec
on a workspace that has folders with.gitignore
files that contain*
(which basically tells git to ignore this whole folder), it completely breaks ignores for the rest of the workspace.You can clone this repro repo to see it in action:
https://github.com/Cammisuli/watch-exec-repro
Steps to reproduce:
clone repo
Open in vscode with rust analyzer (this just enables that files in the
target/
directory is automatically changed)run
watchexec --project-origin=. -- echo '$WATCHEXEC_WRITTEN_PATH'
change
src/main.rs
(add a comment or whatever)See output
main.rs
, but we get everything intarget/
as well.Stop the
watchexec
commandDelete
this-should-ignore-children/.gitignore
(or change the glob to something else)run
watchexec --project-origin=. -- echo '$WATCHEXEC_WRITTEN_PATH'
change
src/main.rs
Output is only
src/main.rs
-vvvv --log-file
watchexec.2023-05-02T18-19-42Z.log
I'll try and investigate this myself and post any findings.
The text was updated successfully, but these errors were encountered: