> -----Original Message----- > From: Jeff Hostetler <git@xxxxxxxxxxxxxxxxx> > Sent: Wednesday, September 7, 2022 3:15 PM > To: Eric DeCosta <edecosta@xxxxxxxxxxxxx>; Eric DeCosta via GitGitGadget > <gitgitgadget@xxxxxxxxx>; git@xxxxxxxxxxxxxxx > Subject: Re: [PATCH v4 4/4] fsmonitor: normalize FSEvents event paths to the > real path > > > > On 9/6/22 3:33 PM, Eric DeCosta wrote: > > > > > [...] > > > > This is informative: > > > > https://developer.apple.com/forums/thread/120665 > > <https://protect- > us.mimecast.com/s/Vj1mCL9GlLUjmyJjfqLBqG?domain=devel > > oper.apple.com> > > > > -Eric > > > > > > How strange........ > > Have you tried the: > fcntl(F_GETPATH) > vs fcntl(F_GETPATH_NOFIRMLINK) > vs realpath() > > comparison suggested in the comments and does it return anything sensical? > Such that we could record both spellings when the daemon starts up. I think > we'd have to do it on an open fd on the worktree root directory. > > Jeff > > > https://developer.apple.com/forums/thread/120665 <https://protect- > us.mimecast.com/s/Vj1mCL9GlLUjmyJjfqLBqG?domain=developer.apple.com > > I'm not getting the same result: Worktree is: '/System/Volumes/Data/mathworks/devel/sandbox/edecosta/git' F_GETPATH of worktree is '/System/Volumes/Data/mathworks/devel/sandbox/edecosta/git' F_GETPATH_NOFIRMLINK of worktree is '/System/Volumes/Data/mathworks/devel/sandbox/edecosta/git' realpath() of worktree is '/System/Volumes/Data/mathworks/devel/sandbox/edecosta/git' Trying /mathworks/devel/sandbox/edecosta/git F_GETPATH of /mathworks/devel/sandbox/edecosta/git is '/System/Volumes/Data/mathworks/devel/sandbox/edecosta/git' F_GETPATH_NOFIRMLINK of /mathworks/devel/sandbox/edecosta/git is '/System/Volumes/Data/mathworks/devel/sandbox/edecosta/git' realpath() of /mathworks/devel/sandbox/edecosta/git is '/System/Volumes/Data/mathworks/devel/sandbox/edecosta/git' Either something has changed or the fact that "/mathworks" is a "synthetic firmlink" has something to do with it. Maybe look for synthetic firmlinks in the root directory and use that information to figure out what aliases there might be to the worktree. lrwxr-xr-x 1 root wheel 30 Sep 2 11:52 mathworks -> /System/Volumes/Data/mathworks If what the link resolves to is a prefix of the worktree, then it is a firmlink to the worktree. Something like that. -Eric