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
git-sync-on-inotify can let certain changes slip through #23
Comments
https://github.com/cortesi/modd seems to work well in my tests, and in particular seems to handle both of the above cases as expected. I use this modd.conf:
|
Hi, nice catch! I guess the shortcomings should be addressed and documented, maybe @IvanMalison can whip something up? I think most - but not all - cases could be catched by adding e.g. a one second delay before git scans for changes. What do you think? |
To close this I propose to move both solutions to a new /contrib directory. If there are any concerns please speak up. |
I don't think a delay will fix this. I recommend documenting the shortcomings until there is a fix. I don't plan to work on this as I switched to modd. |
Yes, I'll document the shortcomings and move. Is your modd.conf still valid and are you OK with putting it under contrib? |
I pushed the move to contrib/, please have a look. As an aside, I think git-sync-on-inotify with GIT_SYNC_INTERVAL will be OK and in some cases better. I have documented the state of affairs so users can make an informed choice. |
See github/cortesi/modd Thanks to @Dieterbe for bringing this up!
@IvanMalison you might also want to have a look! |
See github/cortesi/modd Thanks to @Dieterbe for bringing this up!
yeah i still use the same config as i shared earlier. works fine for me. cheers! |
Thanks for letting me know! BTW I dropped the |
touch foo.1 foo.2
,$changedFile
will be "foo.1") so if you write to multiple files simultaneously, if the first file is in .gitignore, the git-sync will be skipped and the change to the other (non ignored files) will be "forgotten about".notifywait
(e.g. while GIT_SYNC_COMMAND is running, or while the ignore check is running) are unnoticed and "forgotten about"the first issue can be solved by running
inotifywait -m
and processing all events - or leaving the gitignore related work up to GIT_SYNC_COMMAND.the second can be solved by running inotifywait without a timeout, so it catches everything, and concurrently - in another thread - implement the timeout (e.g. with a sleep) to periodically trigger the sync. But I'm not sure how to do this all in bash in a way that we don't concurrently run two syncs (one due to an inotifywait event and one due to a timeout), doing this in something like Go would make more sense... maybe we should just document the shortcomings for the bash version, and defer to another program for more advanced/fewer edge cases. I'm sure they exist but i'll need to search around a bit.
The text was updated successfully, but these errors were encountered: