eaburns/Watch

Watching inside git repo = too many open files

krak3n opened this issue · 1 comments

Hi

When running inside a Git repo it attempts to watch all the files the .git directory, this results in too many open file errors.

Solution would be to allow the user to create a .watch file in which you can write exclude or include regex rules.

Here is my debug outout from OSX.

↳ Watch -t -d go test
2014/01/21 09:30:34 DEBUG: Watching .git/hooks
2014/01/21 09:30:34 DEBUG: Watching .git/info
2014/01/21 09:30:34 DEBUG: Watching .git/logs/refs/heads
2014/01/21 09:30:34 DEBUG: Watching .git/logs/refs/remotes/origin
2014/01/21 09:30:34 DEBUG: Watching .git/logs/refs/remotes
2014/01/21 09:30:34 DEBUG: Watching .git/logs/refs
2014/01/21 09:30:34 DEBUG: Watching .git/logs
2014/01/21 09:30:34 DEBUG: Watching .git/objects/02
2014/01/21 09:30:34 DEBUG: Watching .git/objects/03
...
lots of git files
...
2014/01/21 09:30:34 DEBUG: Watching .git
2014/01/21 09:30:34 DEBUG: Watching .
go test
fork/exec /usr/local/go/bin/go: too many open files
2014-01-21 09:30:34.391614237 +0000 GMT

Chris

Thanks. I'll try to get to this within the next few days. I want to avoid dot files, so I'll probably add a command line flag.