Gitwatch: Not all relevant events are detected

Created on 6 Dec 2012  ·  9Comments  ·  Source: gitwatch/gitwatch

Asking inotifywait without event create does not detect directory creation and none of the files created within it (at least on my system (which uses inotify-tools-3.13).

Also, you may add the event move_self (or just move to get to/from) to detect files moved out of the watched directory. E.g., watched directory is /foo/ and you move file /foo/bar into /tmp/.

help wanted

Most helpful comment

I've not investigated fully but the events used also causes issues on Windows with inotify-win. inotify-win events are: create, modify, delete, move. Removing the event list from the script fixes the problem.

With the event list specified nothing happens until you do something like git status. Then it seems to see the changes and runs.

Perhaps it could be an optional arg?

Other than that it's working well on Windows.

All 9 comments

Yeah, the events I have in the script i added because those are the ones that I saw occurring in the situation i first wrote the script for. I'll try and investigate a bit more about which events are necessary/useful (like the ones you suggested, maybe others). Some of them might also be enabled with command line switches. Another thing to look at is if any of the event types were recently added (so as to not introduce an incompatibilty with a slightly-older inotfytools version).

Any further relevant events should be discussed in this issue, thus leaving it open for now.

I've not investigated fully but the events used also causes issues on Windows with inotify-win. inotify-win events are: create, modify, delete, move. Removing the event list from the script fixes the problem.

With the event list specified nothing happens until you do something like git status. Then it seems to see the changes and runs.

Perhaps it could be an optional arg?

Other than that it's working well on Windows.

I've added a pull request for the optional arg suggestion: https://github.com/nevik/gitwatch/pull/17

mfw someone posts on this project

That's a nice catch! I was not aware inotify-tools had been ported to Windows.

Passing the interesting events via an argument is certainly useful.

Unfortunately the excludes option needs a windows path and when running from mingw bash ${TARGETDIR} obviously gives a unix path. So I need another workaround.

Hm, that might be a limitation of MinGW though, and possibly hard to work around. I've no experience with that kind of thing in particular, but if you have things to test, let me know (if you start working on it, feel free to open a PR to track the changes).

As 429c4af5bf28d015dd3aab8964291ae4c4ec9be6 adds a commandline switch to let the user specify which events to monitor, this issue is pending to be closed once that commit gets merged into master. (Someone remind me if I forget after merging.)

It would be great if someone could volunteer to test this fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hongkongkiwi picture hongkongkiwi  ·  3Comments

Alwaysin picture Alwaysin  ·  8Comments

lehnerpat picture lehnerpat  ·  7Comments

miguelarauj1o picture miguelarauj1o  ·  7Comments

ain picture ain  ·  3Comments