joh / when-changed

Execute a command when a file is changed
Other
1.21k stars 107 forks source link

add .git and __pycache__ dir to ignored list #51

Closed leogermond closed 7 years ago

leogermond commented 7 years ago

This patch changes a bit the exclude regex definition and allow a check on the full path; then it also adds an ignore for .git and pycache directories, that can add spurious changes detections when the script is set to be recursive.

Detection of changes on a .git could be used to detect git activity: commit, fetch, merge or rebase; so it would not be entirely useless; however I never saw anyone using it for that; so I guess it could be made optionnaly available.

This patch also opens the way to declaring a full path ignore regex over the command line (bug #16) and, along with the PR #50, this could probably be added in about 3 loc.

joh commented 7 years ago

I guess you typically use git hooks to run stuff on commits etc, so I think ignoring .git should be fine.

joh commented 7 years ago

Thank you, a command-line option to exclude stuff would be nice. Feel free to PR :)