git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "srz_zumix via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: srz_zumix <zumix.cpp@gmail.com>, srz_zumix <zumix.cpp@gmail.com>
Subject: [PATCH] fsmonitor--daemon: on macOS support symlink
Date: Tue, 08 Nov 2022 05:25:19 +0000	[thread overview]
Message-ID: <pull.1406.git.1667885119570.gitgitgadget@gmail.com> (raw)

From: srz_zumix <zumix.cpp@gmail.com>

Resolves a problem where symbolic links were not showing up in diff when
created or modified.

kFSEventStreamEventFlagItemIsSymlink is also treated as a file update.
This is because kFSEventStreamEventFlagItemIsFile is not included in
FSEvents when creating or deleting symbolic links. For example:

$ ln -snf t test
  fsevent: '/path/to/dir/test', flags=0x40100 ItemCreated|ItemIsSymlink|
$ ln -snf ci test
  fsevent: '/path/to/dir/test', flags=0x40200 ItemIsSymlink|ItemRemoved|
  fsevent: '/path/to/dir/test', flags=0x40100 ItemCreated|ItemIsSymlink|

Signed-off-by: srz_zumix <zumix.cpp@gmail.com>
---
    fsmonitor--daemon: on macOS support symlink
    
    Resolves a problem where symbolic links were not showing up in diff when
    created or modified. (on macOS with git config core.fsmonitor=true)

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1406%2Fsrz-zumix%2Ffeature%2Fdarwin_symlink-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1406/srz-zumix/feature/darwin_symlink-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1406

 compat/fsmonitor/fsm-listen-darwin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c
index daeee4e465c..cc9af1e3cb3 100644
--- a/compat/fsmonitor/fsm-listen-darwin.c
+++ b/compat/fsmonitor/fsm-listen-darwin.c
@@ -336,7 +336,7 @@ static void fsevent_callback(ConstFSEventStreamRef streamRef,
 			 * know how much to invalidate/refresh.
 			 */
 
-			if (event_flags[k] & kFSEventStreamEventFlagItemIsFile) {
+			if (event_flags[k] & (kFSEventStreamEventFlagItemIsFile | kFSEventStreamEventFlagItemIsSymlink)) {
 				const char *rel = path_k +
 					state->path_worktree_watch.len + 1;
 

base-commit: 3b08839926fcc7cc48cf4c759737c1a71af430c1
-- 
gitgitgadget

             reply	other threads:[~2022-11-08  5:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-08  5:25 srz_zumix via GitGitGadget [this message]
2022-11-08 21:35 ` [PATCH] fsmonitor--daemon: on macOS support symlink Taylor Blau
2022-11-15 16:14   ` Jeff Hostetler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.1406.git.1667885119570.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=zumix.cpp@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).