{"thread":{"id":"59215","subject":"[git v2.39.1] Strange behavior with fsmonitor on MacOS","startedAt":"2023-02-09T03:28:50Z","lastAt":"2023-02-09T03:28:50Z","messageCount":1,"participants":["Anton Lopyrev"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"471835","messageId":"CAN6BazqXXkOHLQok_MN8BLmyPD8MFeLNX-CcRb6eC+xx-5GPcQ@mail.gmail.com","threadId":"59215","inReplyTo":null,"subject":"[git v2.39.1] Strange behavior with fsmonitor on MacOS","fromName":"Anton Lopyrev","fromEmail":"anton@snap.com","sentAt":"2023-02-09T03:26:23Z","receivedAt":"2023-02-09T03:28:50Z","isPatch":false,"sender":{"key":"anton@snap.com","avatar":null},"body":"Hi there,\n\nI work on the developer productivity team at Snap Inc and we\ndiscovered a strange behavior with fsmonitor in git v2.39.1, which\nconsistently happens in one of our repos. We are unable to reproduce\nthis issue in any other internal or public repos, but the issue also\ndoesn’t seem to be reproducible when using the microsoft/git fork\n(v2.39.1.vfs.0.0 - we use it for our largest repos). As a result, we\nare unsure if we are running into a bug in git or an issue specific to\nour repo (or both?). We appreciate any pointers in advance!\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n- clone the repo via git clone (all default settings)\n- git config core.fsmonitor true\n- git status\n- git diff-index HEAD\n\nWhat did you expect to happen? (Expected behavior)\n- 'git diff-index HEAD' is expected to return nothing\n\nWhat happened instead? (Actual behavior)\n- 'git diff-index HEAD' around ~44k files, which are all marked as deleted\n- Example: ':100755 000000 fdc71572fe4e3ceb9305a8990d9d950e7bac6aa5\n0000000000000000000000000000000000000000 D\nsrc/adl/talkcorev3/generate_protos.sh'\n- 44k files is amount 60% of the entire repo, there is no clear\npattern in the list of file paths (or attributes)\n\nWhat's different between what you expected and what actually happened?\n- Since the repo was just cloned, there are no changed files, so the\noutput of git diff-index should be empty.\n\nAnything else you want to add:\n- As I mentioned above, if we try using microsoft-git fork\n(v2.39.1.vfs.0.0), the issue is no longer reproducible. No re-cloning\nis necessary, simply installing v2.39.1.vfs.0.0 and running `git\ndiff-index HEAD` will return the correct result. Reverting back to\nregular git, the issue is reproducible again.\n- If you turn off fsmonitor, the issue is no longer reproducible.\n- The issue is still reproducible if you switch from built-in MacOS\nfsmonitor to watchman.\n- A few notes about the repo:\n  - it uses git lfs\n  - it has around 23 submodules\n  - Server-side we use GitHub Enterprise Server 3.5.7\n- A few things we have checked, but without any luck:\n  - various known problems around file permissions\n  - various known problems around line endings\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.39.1\ncpu: arm64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nfeature: fsmonitor--daemon\nuname: Darwin 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51\nPST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000 arm64\ncompiler info: clang: 14.0.0 (clang-1400.0.29.202)\nlibc info: no libc information available\n$SHELL (typically, interactive shell): /bin/bash\n"}]}