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

Allow excluding file patterns by passing in a file #60

Closed
bengillies opened this issue Oct 7, 2014 · 9 comments
Closed

Allow excluding file patterns by passing in a file #60

bengillies opened this issue Oct 7, 2014 · 9 comments
Milestone

Comments

@bengillies
Copy link

Basically what I'd like is to pass in my .gitignore file(s) and have it exclude everything that matches rather than specify everything via regexp.

@emcrisostomo
Copy link
Owner

Hi @bengillies,

In fact, this is an issue which has already been requested. I leave it open for reference and hope I'll be able to integrate it quite soon. The only catch I have (that I have not investigated yet) is a convenient way to implement the ** wildcard in patterns, since AFAIK functions like glob or fnmatch do not recognize it.

If someone has got an idea about this, let's brainstorm, since end of the year is quite a busy time.

Cheers,
-- Enrico

@bengillies
Copy link
Author

Thanks for replying so quickly. I'm afraid I'm not much of a C++ person so probably not much help.

Question though: does it really need to support ** immediately?

@emcrisostomo
Copy link
Owner

You're welcome.

Well, it certainly needs not, although I'd like to avoid confusing the users. git had the same problems some time ago: ** was initially implemented only on certain systems, leading users to quite a good deal of confusion.

I want to have a look at git sources to check what they've done and then decide what I'll do. I'm just short of time.

I'll then consider omitting implementing ** and see how it goes.

Cheers,
-- Enrico

@ricardobeat
Copy link

@emcrisostomo any updates on this?

@grayside
Copy link

globstar is supported by default on Bash 4

@emcrisostomo
Copy link
Owner

Hi @ricardobeat, I'm afraid this issue hasn't been worked on yet.

@fernandomora
Copy link

+1

@ricardobeat
Copy link

In the meantime, git-check-ignore allows deferring this logic togit itself: fswatch . | while read file; do git check-ignore -q $file || echo $file; done

@emcrisostomo emcrisostomo added this to the 1.9.4 milestone Oct 28, 2016
@emcrisostomo
Copy link
Owner

Being able to exclude files is important so that fswatch can exert a lesser load on the system, especially when the monitor uses limited resources such as file descriptors. Trimming an otherwise huge file hierarchy is a feature that is definitely required. Maintaining the current implementation (a fswatch-specific syntax) is OK to me.

Having fswatch understand other exclude file types may be nice, but it's not only essential: the output can be filtered, how a user exactly wants. Furthermore, as @ricardobeat pointed out, in the case of git it's very easy to check a path against the ignore patterns.

I'm closing this issue and I'll probably add an example using git check-ignore to the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants