Skip to content

pr-1143/jeffhostetler/builtin-fsmonitor-part3-v9

Here is version 9 of part 3 of FSMonitor.

This version addresses the test failure on t7527.[56] when deleting/renaming
the .git directory using the "GIT~1" spelling. Between v6 and v7, I changed
the way check_for_shortnames() constructed the wchar_t path to .git from a
pair of wcscpy() calls to a swprintf() call. However, I used a "%s" by
mistake rather than a "%ls".

This caused a non-portable behavior. The tests passed with MSVC and with GCC
10.1.0 on my laptop, but failed under GCC on one of the CI build machines.

This was partially hidden by CI machines that have GCC 12 and that fail to
compile Git without the fixes for GCC 12.x.

Jeff Hostetler (30):
  fsm-listen-win32: handle shortnames
  t7527: test FSMonitor on repos with Unicode root paths
  t/helper/fsmonitor-client: create stress test
  fsmonitor-settings: bare repos are incompatible with FSMonitor
  fsmonitor-settings: stub in Win32-specific incompatibility checking
  fsmonitor-settings: VFS for Git virtual repos are incompatible
  fsmonitor-settings: stub in macOS-specific incompatibility checking
  fsmonitor-settings: remote repos on macOS are incompatible
  fsmonitor-settings: remote repos on Windows are incompatible
  fsmonitor-settings: NTFS and FAT32 on MacOS are incompatible
  unpack-trees: initialize fsmonitor_has_run_once in o->result
  fsm-listen-darwin: ignore FSEvents caused by xattr changes on macOS
  fsmonitor--daemon: cd out of worktree root
  fsmonitor--daemon: prepare for adding health thread
  fsmonitor--daemon: rename listener thread related variables
  fsmonitor--daemon: stub in health thread
  fsm-health-win32: add polling framework to monitor daemon health
  fsm-health-win32: force shutdown daemon if worktree root moves
  fsm-listen-darwin: shutdown daemon if worktree root is moved/renamed
  fsmonitor: optimize processing of directory events
  t7527: FSMonitor tests for directory moves
  t/perf/p7527: add perf test for builtin FSMonitor
  fsmonitor: never set CE_FSMONITOR_VALID on submodules
  t7527: test FSMonitor on case insensitive+preserving file system
  fsmonitor: on macOS also emit NFC spelling for NFD pathname
  t/helper/hexdump: add helper to print hexdump of stdin
  t/lib-unicode-nfc-nfd: helper prereqs for testing unicode nfc/nfd
  t7527: test Unicode NFC/NFD handling on MacOS
  fsmonitor--daemon: allow --super-prefix argument
  t7527: improve implicit shutdown testing in fsmonitor--daemon

 Makefile                               |  20 +-
 builtin/fsmonitor--daemon.c            | 116 ++++++-
 builtin/update-index.c                 |  16 +
 compat/fsmonitor/fsm-health-darwin.c   |  24 ++
 compat/fsmonitor/fsm-health-win32.c    | 278 ++++++++++++++++
 compat/fsmonitor/fsm-health.h          |  47 +++
 compat/fsmonitor/fsm-listen-darwin.c   | 122 ++++++-
 compat/fsmonitor/fsm-listen-win32.c    | 436 ++++++++++++++++++++-----
 compat/fsmonitor/fsm-listen.h          |   2 +-
 compat/fsmonitor/fsm-settings-darwin.c |  89 +++++
 compat/fsmonitor/fsm-settings-win32.c  | 137 ++++++++
 config.mak.uname                       |   5 +
 contrib/buildsystems/CMakeLists.txt    |   8 +
 fsmonitor--daemon.h                    |  11 +-
 fsmonitor-settings.c                   | 167 ++++++++--
 fsmonitor-settings.h                   |  33 ++
 fsmonitor.c                            |  73 ++++-
 fsmonitor.h                            |  11 +
 git.c                                  |   2 +-
 t/helper/test-fsmonitor-client.c       | 106 ++++++
 t/helper/test-hexdump.c                |  30 ++
 t/helper/test-tool.c                   |   1 +
 t/helper/test-tool.h                   |   1 +
 t/lib-unicode-nfc-nfd.sh               | 162 +++++++++
 t/perf/p7527-builtin-fsmonitor.sh      | 257 +++++++++++++++
 t/t7519-status-fsmonitor.sh            |  32 ++
 t/t7527-builtin-fsmonitor.sh           | 401 ++++++++++++++++++++++-
 unpack-trees.c                         |   1 +
 28 files changed, 2439 insertions(+), 149 deletions(-)
 create mode 100644 compat/fsmonitor/fsm-health-darwin.c
 create mode 100644 compat/fsmonitor/fsm-health-win32.c
 create mode 100644 compat/fsmonitor/fsm-health.h
 create mode 100644 compat/fsmonitor/fsm-settings-darwin.c
 create mode 100644 compat/fsmonitor/fsm-settings-win32.c
 create mode 100644 t/helper/test-hexdump.c
 create mode 100755 t/lib-unicode-nfc-nfd.sh
 create mode 100755 t/perf/p7527-builtin-fsmonitor.sh

base-commit: 5eb696daba2fe108d4d9ba2ccf4b357447ef9946

Submitted-As: https://lore.kernel.org/git/pull.1143.v9.git.1653601644.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1143.git.1644940773.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1143.v2.git.1646777727.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1143.v3.git.1647973380.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1143.v4.git.1648140680.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1143.v5.git.1650487398.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1143.v6.git.1650662994.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1143.v7.git.1653336765.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1143.v8.git.1653490852.gitgitgadget@gmail.com
Assets 2