]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jh/builtin-fsmonitor-part3'
authorJunio C Hamano <gitster@pobox.com>
Fri, 10 Jun 2022 22:04:14 +0000 (15:04 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Jun 2022 22:04:15 +0000 (15:04 -0700)
More fsmonitor--daemon.

* jh/builtin-fsmonitor-part3: (30 commits)
  t7527: improve implicit shutdown testing in fsmonitor--daemon
  fsmonitor--daemon: allow --super-prefix argument
  t7527: test Unicode NFC/NFD handling on MacOS
  t/lib-unicode-nfc-nfd: helper prereqs for testing unicode nfc/nfd
  t/helper/hexdump: add helper to print hexdump of stdin
  fsmonitor: on macOS also emit NFC spelling for NFD pathname
  t7527: test FSMonitor on case insensitive+preserving file system
  fsmonitor: never set CE_FSMONITOR_VALID on submodules
  t/perf/p7527: add perf test for builtin FSMonitor
  t7527: FSMonitor tests for directory moves
  fsmonitor: optimize processing of directory events
  fsm-listen-darwin: shutdown daemon if worktree root is moved/renamed
  fsm-health-win32: force shutdown daemon if worktree root moves
  fsm-health-win32: add polling framework to monitor daemon health
  fsmonitor--daemon: stub in health thread
  fsmonitor--daemon: rename listener thread related variables
  fsmonitor--daemon: prepare for adding health thread
  fsmonitor--daemon: cd out of worktree root
  fsm-listen-darwin: ignore FSEvents caused by xattr changes on macOS
  unpack-trees: initialize fsmonitor_has_run_once in o->result
  ...

1  2 
Makefile
builtin/update-index.c
compat/fsmonitor/fsm-listen-darwin.c
config.mak.uname
contrib/buildsystems/CMakeLists.txt
git.c
t/helper/test-tool.c
t/helper/test-tool.h
t/t7519-status-fsmonitor.sh
unpack-trees.c

diff --cc Makefile
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc git.c
Simple merge
Simple merge
Simple merge
index d4f9c6a837b18075a3bff10a7c87e7932e4e46fe,156895f943747017dd249954913bc8baf6c7d803..8348e3ae7db70d9c6a65606c3b400c485a3a8719
@@@ -55,7 -55,40 +55,39 @@@ test_lazy_prereq UNTRACKED_CACHE 
        test $ret -ne 1
  '
  
+ # Test that we detect and disallow repos that are incompatible with FSMonitor.
+ test_expect_success 'incompatible bare repo' '
+       test_when_finished "rm -rf ./bare-clone actual expect" &&
+       git init --bare bare-clone &&
+       test_must_fail \
+               git -C ./bare-clone -c core.fsmonitor=foo \
+                       update-index --fsmonitor 2>actual &&
+       grep "bare repository .* is incompatible with fsmonitor" actual &&
+       test_must_fail \
+               git -C ./bare-clone -c core.fsmonitor=true \
+                       update-index --fsmonitor 2>actual &&
+       grep "bare repository .* is incompatible with fsmonitor" actual
+ '
+ test_expect_success FSMONITOR_DAEMON 'run fsmonitor-daemon in bare repo' '
+       test_when_finished "rm -rf ./bare-clone actual" &&
+       git init --bare bare-clone &&
+       test_must_fail git -C ./bare-clone fsmonitor--daemon run 2>actual &&
+       grep "bare repository .* is incompatible with fsmonitor" actual
+ '
+ test_expect_success MINGW,FSMONITOR_DAEMON 'run fsmonitor-daemon in virtual repo' '
+       test_when_finished "rm -rf ./fake-virtual-clone actual" &&
+       git init fake-virtual-clone &&
+       test_must_fail git -C ./fake-virtual-clone \
+                          -c core.virtualfilesystem=true \
+                          fsmonitor--daemon run 2>actual &&
+       grep "virtual repository .* is incompatible with fsmonitor" actual
+ '
  test_expect_success 'setup' '
 -      mkdir -p .git/hooks &&
        : >tracked &&
        : >modified &&
        mkdir dir1 &&
diff --cc unpack-trees.c
index 7d73f62aee3e80e95cd0da2fbed44f4b7ae4c1b2,888cff81f9c51126c0b1858a0db874574d92cd73..d561ca01ed249e8c097c08a791ed99e7dfbb0dc5
@@@ -1840,12 -1772,8 +1840,13 @@@ int unpack_trees(unsigned len, struct t
  
        o->result.fsmonitor_last_update =
                xstrdup_or_null(o->src_index->fsmonitor_last_update);
+       o->result.fsmonitor_has_run_once = o->src_index->fsmonitor_has_run_once;
  
 +      if (!o->src_index->initialized &&
 +          !repo->settings.command_requires_full_index &&
 +          is_sparse_index_allowed(&o->result, 0))
 +              o->result.sparse_index = 1;
 +
        /*
         * Sparse checkout loop #1: set NEW_SKIP_WORKTREE on existing entries
         */