{"thread":{"id":"58761","subject":"[PATCH] fsmonitor--daemon: on macOS support symlink","startedAt":"2022-11-08T05:25:28Z","lastAt":"2022-11-15T16:14:58Z","messageCount":3,"participants":["srz_zumix via GitGitGadget","Taylor Blau","Jeff Hostetler"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"466789","messageId":"pull.1406.git.1667885119570.gitgitgadget@gmail.com","threadId":"58761","inReplyTo":null,"subject":"[PATCH] fsmonitor--daemon: on macOS support symlink","fromName":"srz_zumix via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-11-08T05:25:19Z","receivedAt":"2022-11-08T05:25:28Z","isPatch":true,"sender":{"key":"name:srz_zumix","avatar":null},"body":"From: srz_zumix <zumix.cpp@gmail.com>\n\nResolves a problem where symbolic links were not showing up in diff when\ncreated or modified.\n\nkFSEventStreamEventFlagItemIsSymlink is also treated as a file update.\nThis is because kFSEventStreamEventFlagItemIsFile is not included in\nFSEvents when creating or deleting symbolic links. For example:\n\n$ ln -snf t test\n  fsevent: '/path/to/dir/test', flags=0x40100 ItemCreated|ItemIsSymlink|\n$ ln -snf ci test\n  fsevent: '/path/to/dir/test', flags=0x40200 ItemIsSymlink|ItemRemoved|\n  fsevent: '/path/to/dir/test', flags=0x40100 ItemCreated|ItemIsSymlink|\n\nSigned-off-by: srz_zumix <zumix.cpp@gmail.com>\n---\n    fsmonitor--daemon: on macOS support symlink\n    \n    Resolves a problem where symbolic links were not showing up in diff when\n    created or modified. (on macOS with git config core.fsmonitor=true)\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1406%2Fsrz-zumix%2Ffeature%2Fdarwin_symlink-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1406/srz-zumix/feature/darwin_symlink-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/1406\n\n compat/fsmonitor/fsm-listen-darwin.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c\nindex daeee4e465c..cc9af1e3cb3 100644\n--- a/compat/fsmonitor/fsm-listen-darwin.c\n+++ b/compat/fsmonitor/fsm-listen-darwin.c\n@@ -336,7 +336,7 @@ static void fsevent_callback(ConstFSEventStreamRef streamRef,\n \t\t\t * know how much to invalidate/refresh.\n \t\t\t */\n \n-\t\t\tif (event_flags[k] & kFSEventStreamEventFlagItemIsFile) {\n+\t\t\tif (event_flags[k] & (kFSEventStreamEventFlagItemIsFile | kFSEventStreamEventFlagItemIsSymlink)) {\n \t\t\t\tconst char *rel = path_k +\n \t\t\t\t\tstate->path_worktree_watch.len + 1;\n \n\nbase-commit: 3b08839926fcc7cc48cf4c759737c1a71af430c1\n-- \ngitgitgadget\n"},{"id":"466903","messageId":"Y2rLr5zJTnqownCT@nand.local","threadId":"58761","inReplyTo":"pull.1406.git.1667885119570.gitgitgadget@gmail.com","subject":"Re: [PATCH] fsmonitor--daemon: on macOS support symlink","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2022-11-08T21:35:43Z","receivedAt":"2022-11-08T21:35:48Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Tue, Nov 08, 2022 at 05:25:19AM +0000, srz_zumix via GitGitGadget wrote:\n> From: srz_zumix <zumix.cpp@gmail.com>\n>\n> Resolves a problem where symbolic links were not showing up in diff when\n> created or modified.\n\nLooks reasonable to me. Adding Jeff Hostetler (cc'd) as a possible\nreviewer.\n\nThanks,\nTaylor\n"},{"id":"467310","messageId":"7ca10b13-7041-c730-c92f-4cff07783746@jeffhostetler.com","threadId":"58761","inReplyTo":"Y2rLr5zJTnqownCT@nand.local","subject":"Re: [PATCH] fsmonitor--daemon: on macOS support symlink","fromName":"Jeff Hostetler","fromEmail":"git@jeffhostetler.com","sentAt":"2022-11-15T16:14:53Z","receivedAt":"2022-11-15T16:14:58Z","isPatch":true,"sender":{"key":"git@jeffhostetler.com","avatar":null},"body":"\n\nOn 11/8/22 4:35 PM, Taylor Blau wrote:\n> On Tue, Nov 08, 2022 at 05:25:19AM +0000, srz_zumix via GitGitGadget wrote:\n>> From: srz_zumix <zumix.cpp@gmail.com>\n>>\n>> Resolves a problem where symbolic links were not showing up in diff when\n>> created or modified.\n> \n> Looks reasonable to me. Adding Jeff Hostetler (cc'd) as a possible\n> reviewer.\n> \n> Thanks,\n> Taylor\n\nThis looks good to me too.  Thanks!\n"}]}