File: day_158__fsevents.mdwn

package info (click to toggle)
git-annex 10.20250416-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 73,572 kB
  • sloc: haskell: 90,656; javascript: 9,103; sh: 1,469; makefile: 211; perl: 137; ansic: 44
file content (20 lines) | stat: -rw-r--r-- 952 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Investigated using the OSX fsevents API to detect when files are modified,
so they can be committed when using direct mode. There's a
[haskell library](http://hackage.haskell.org/package/hfsevents-0.1.3)
and even a [sample directory watching program](http://hackage.haskell.org/package/hobbes).
Initial tests look good...

Using fsevents will avoid kqueue's problems with needing enough file
descriptors to open every subdirectory. kqueue is a rather poor match for
git-annex's needs, really. It does not seem to provide events for file
modifications at all, unless every *file* is individually opened. While I
dislike leaving the BSD's out, they need a better interface to be perfectly
supported by git-annex, and kqueue will still work for indirect mode
repositories.

----

Got the assistant to use fsevents. It seems to work well!

The only problem I know of is that it doesn't yet handle whole directory
renames. That should be easy to fix later.