Skip to content

inotify support

Nguyễn Thái Ngọc Duy git 3 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest26 patches 7 repliesIn review
  2. v211 of 14 patches 13 repliesSuperseded
  3. v16 patches 6 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/26pkt-line.c: rename global variable buffer[] to something less genericpkt-line.c+6 -50 replies
2/26pkt-line.c: add packet_write_timeout()cache.h pkt-line.c pkt-line.h +1 more+43 -00 replies
3/26pkt-line.c: add packet_read_line_timeout()cache.h pkt-line.c pkt-line.h +1 more+58 -00 replies
4/26unix-socket: make unlink() optional in unix_stream_listen()credential-cache--daemon.c unix-socket.c unix-socket.h+5 -40 replies
5/26Add git-file-watcher and basic connection handling logic.gitignore Documentation/git-file-watcher.txt Makefile +1 more+171 -00 replies
6/26file-watcher: check socket directory permissionfile-watcher.c+32 -00 replies
7/26file-watcher: remove socket on exitfile-watcher.c+23 -10 replies
8/26file-watcher: add --detachDocumentation/git-file-watcher.txt cache.h daemon.c +2 more+49 -260 replies
9/26read-cache: save trailing sha-1cache.h read-cache.c+5 -30 replies
10/26read-cache: new flag CE_WATCHED to mark what file is watchedDocumentation/technical/index-format.txt cache.h read-cache.c+49 -10 replies
11/26Clear CE_WATCHED when set CE_VALID alonebuiltin/update-index.c read-cache.c+9 -50 replies
12/26read-cache: basic hand shaking to the file watcherDocumentation/config.txt Documentation/git-file-watcher.txt Makefile +5 more+269 -20 replies
13/26read-cache: ask file watcher to watch filesfile-watcher-lib.c file-watcher-lib.h file-watcher.c +1 more+191 -20 replies
14/26read-cache: put some limits on file watchingDocumentation/config.txt Documentation/technical/index-format.txt cache.h +2 more+56 -100 replies
15/26read-cache: get changed file list from file watchercache.h file-watcher-lib.c file-watcher-lib.h +2 more+258 -20 replies
16/26git-compat-util.h: add inotify stubs on non-Linux platformsconfig.mak.uname git-compat-util.h+44 -00 replies
17/26file-watcher: inotify support, watching partDocumentation/git-file-watcher.txt file-watcher.c+238 -10 replies
18/26file-watcher: inotify support, notification partfile-watcher.c+141 -10 replies
19/26Wrap CE_VALID test with ce_valid()builtin/grep.c cache.h diff-lib.c +3 more+12 -80 replies
20/26read-cache: new variable to verify file-watcher resultsDocumentation/git-file-watcher.txt cache.h read-cache.c+29 -10 replies
21/26Support running file watcher with the test suitefile-watcher-lib.c+13 -00 replies
22/26file-watcher: quit if $WATCHER/socket is gonefile-watcher.c+24 -20 replies
23/26file-watcher: tests for the daemon.gitignore Makefile file-watcher.c +2 more+657 -40 replies
24/26ls-files: print CE_WATCHED as W (or "w" with CE_VALID)Documentation/git-ls-files.txt builtin/ls-files.c+13 -20 replies
25/26file-watcher: tests for the client sidefile-watcher-lib.c t/t7514-file-watcher-lib.sh test-file-watcher.c+219 -70 replies
26/26Disable file-watcher with system inotify on some testst/t1011-read-tree-sparse-checkout.sh t/t2104-update-index-skip-worktree.sh t/t7011-skip-worktree-reading.sh +1 more+8 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 00/26] inotify support

I'm happy with this now. The only things left are applying ewah on the watch index extension and maybe improve lookup performance a bit. The former needs jk/pack-bitmap graduated. The latter is not urgent. Oh and maybe address "BUGS" section (more like known limitations) in git-file-watcher.txt.

For early adopters that fear a buggy file-watcher may cause update loss, set GIT_TEST_WATCHED=1 (or 2). It'll do lstat() to verify file-watcher results (so no perf. gain). Beware of race condition that may lead to false positives, mentioned in 20/26 (maybe I should do something about it).

The series can also be fetched from

https://github.com/pclouds/git.git file-watcher

Nguyễn Thái Ngọc Duy (26):
pkt-line.c: rename global variable buffer[] to something less generic pkt-line.c: add packet_write_timeout()
pkt-line.c: add packet_read_line_timeout()
unix-socket: make unlink() optional in unix_stream_listen() Add git-file-watcher and basic connection handling logic
file-watcher: check socket directory permission
file-watcher: remove socket on exit
file-watcher: add --detach
read-cache: save trailing sha-1
read-cache: new flag CE_WATCHED to mark what file is watched Clear CE_WATCHED when set CE_VALID alone
read-cache: basic hand shaking to the file watcher
read-cache: ask file watcher to watch files
read-cache: put some limits on file watching
read-cache: get changed file list from file watcher git-compat-util.h: add inotify stubs on non-Linux platforms
file-watcher: inotify support, watching part
file-watcher: inotify support, notification part
Wrap CE_VALID test with ce_valid()
read-cache: new variable to verify file-watcher results Support running file watcher with the test suite
file-watcher: quit if $WATCHER/socket is gone
file-watcher: tests for the daemon
ls-files: print CE_WATCHED as W (or "w" with CE_VALID)
file-watcher: tests for the client side
Disable file-watcher with system inotify on some tests

 .gitignore                               |    2 +
 Documentation/config.txt                 |   19 +
 Documentation/git-file-watcher.txt (new) |   54 ++
 Documentation/git-ls-files.txt           |    1 +
 Documentation/technical/index-format.txt |    9 +
 Makefile                                 |    3 +
 builtin/grep.c                           |    2 +-
 builtin/ls-files.c                       |   14 +-
 builtin/update-index.c                   |   12 +-
 cache.h                                  |   17 +
 config.mak.uname                         |    1 +
 credential-cache--daemon.c               |    2 +-
 daemon.c                                 |   30 +-
 diff-lib.c                               |    4 +-
 diff.c                                   |    2 +-
 file-watcher-lib.c (new)                 |  321 +++++++++
 file-watcher-lib.h (new)                 |    8 +
 file-watcher.c (new)                     | 1149 ++++++++++++++++++++++++++++++
 git-compat-util.h                        |   43 ++
 pkt-line.c                               |   61 +-
 pkt-line.h                               |    2 +
 read-cache.c                             |  119 +++-
 setup.c                                  |   25 +
 t/t1011-read-tree-sparse-checkout.sh     |    2 +
 t/t2104-update-index-skip-worktree.sh    |    2 +
 t/t7011-skip-worktree-reading.sh         |    2 +
 t/t7012-skip-worktree-writing.sh         |    2 +
 t/t7513-file-watcher.sh (new +x)         |  382 ++++++++++
 t/t7514-file-watcher-lib.sh (new +x)     |  190 +++++
 test-file-watcher.c (new)                |  111 +++
 unix-socket.c                            |    5 +-
 unix-socket.h                            |    2 +-
 unpack-trees.c                           |    2 +-
 wrapper.c                                |   47 ++
 34 files changed, 2591 insertions(+), 56 deletions(-)
 create mode 100644 Documentation/git-file-watcher.txt
 create mode 100644 file-watcher-lib.c
 create mode 100644 file-watcher-lib.h
 create mode 100644 file-watcher.c
 create mode 100755 t/t7513-file-watcher.sh
 create mode 100755 t/t7514-file-watcher-lib.sh
 create mode 100644 test-file-watcher.c
Signature · 1 line
1.8.5.2.240.g8478abd