<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/compat/fsmonitor, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-12-19T02:46:14Z</updated>
<entry>
<title>Merge branch 'jh/fsmonitor-darwin-modernize'</title>
<updated>2022-12-19T02:46:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-12-19T02:46:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=636de956c4a942ab3c247eba3a6dbb3113fa7ea8'/>
<id>urn:sha1:636de956c4a942ab3c247eba3a6dbb3113fa7ea8</id>
<content type='text'>
Stop using deprecated macOS API in fsmonitor.

* jh/fsmonitor-darwin-modernize:
  fsmonitor: eliminate call to deprecated FSEventStream function
</content>
</entry>
<entry>
<title>fsmonitor: eliminate call to deprecated FSEventStream function</title>
<updated>2022-12-15T00:08:27Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhostetler@github.com</email>
</author>
<published>2022-12-14T19:12:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b0226007f0aaf448dec1defe3e44c4e3d7513aa8'/>
<id>urn:sha1:b0226007f0aaf448dec1defe3e44c4e3d7513aa8</id>
<content type='text'>
Replace the call to `FSEventStreamScheduleWithRunLoop()` function with
the suggested `FSEventStreamSetDispatchQueue()` function.

The MacOS version of the builtin FSMonitor feature uses the
`FSEventStreamScheduleWithRunLoop()` function to drive the event loop
and process FSEvents from the system.  This routine has now been
deprecated by Apple.  The MacOS 13 (Ventura) compiler tool chain now
generates a warning when compiling calls to this function.  In
DEVELOPER=1 mode, this now causes a compile error.

The `FSEventStreamSetDispatchQueue()` function is conceptually similar
and is the suggested replacement.  However, there are some subtle
thread-related differences.

Previously, the event stream would be processed by the
`fsm_listen__loop()` thread while it was in the `CFRunLoopRun()`
method.  (Conceptually, this was a blocking call on the lifetime of
the event stream where our thread drove the event loop and individual
events were handled by the `fsevent_callback()`.)

With the change, a "dispatch queue" is created and FSEvents will be
processed by a hidden queue-related thread (that calls the
`fsevent_callback()` on our behalf).  Our `fsm_listen__loop()` thread
maintains the original blocking model by waiting on a mutex/condition
variable pair while the hidden thread does all of the work.

While the deprecated API used by the original were introduced in
macOS 10.5 (Oct 2007), the API used by the updated code were
introduced back in macOS 10.6 (Aug 2009) and has been available
since then.  So this change _could_ break those who have happily
been using 10.5 (if there were such people), but these two dates
both predate the oldest versions of macOS Apple seems to support
anyway, so we should be safe.

Signed-off-by: Jeff Hostetler &lt;jeffhostetler@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor--daemon: on macOS support symlink</title>
<updated>2022-11-08T21:36:09Z</updated>
<author>
<name>srz_zumix</name>
<email>zumix.cpp@gmail.com</email>
</author>
<published>2022-11-08T05:25:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ee0e7fc927c309e3ed1d46f7ba970b79d3a38514'/>
<id>urn:sha1:ee0e7fc927c309e3ed1d46f7ba970b79d3a38514</id>
<content type='text'>
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 &lt;zumix.cpp@gmail.com&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor OSX: compile with DC_SHA1=YesPlease</title>
<updated>2022-10-19T16:34:47Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-10-19T01:03:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=32205655dc7ce44863bf79fb05bf170d9ad6da32'/>
<id>urn:sha1:32205655dc7ce44863bf79fb05bf170d9ad6da32</id>
<content type='text'>
As we'll address in subsequent commits the "DC_SHA1=YesPlease" is not
on by default on OSX, instead we use Apple Common Crypto's SHA-1
implementation.

In 6beb2688d33 (fsmonitor: relocate socket file if .git directory is
remote, 2022-10-04) the build was broken with "DC_SHA1=YesPlease" (and
probably other non-"APPLE_COMMON_CRYPTO" SHA-1 backends).

So let's extract the fix for this from [1] to get the build working
again with "DC_SHA1=YesPlease". In addition to the fix in [1] we also
need to replace "SHA_DIGEST_LENGTH" with "GIT_MAX_RAWSZ".

1. https://lore.kernel.org/git/c085fc15b314abcb5e5ca6b4ee5ac54a28327cab.1665326258.git.gitgitgadget@gmail.com/

Signed-off-by: Eric DeCosta &lt;edecosta@mathworks.com&gt;
Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor: deal with synthetic firmlinks on macOS</title>
<updated>2022-10-05T18:05:23Z</updated>
<author>
<name>Eric DeCosta</name>
<email>edecosta@mathworks.com</email>
</author>
<published>2022-10-04T17:32:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=12fd27df79ac5f2589b54c8f36761d066dc9a97e'/>
<id>urn:sha1:12fd27df79ac5f2589b54c8f36761d066dc9a97e</id>
<content type='text'>
Starting with macOS 10.15 (Catalina), Apple introduced a new feature
called 'firmlinks' in order to separate the boot volume into two
volumes, one read-only and one writable but still present them to the
user as a single volume. Along with this change, Apple removed the
ability to create symlinks in the root directory and replaced them with
'synthetic firmlinks'. See 'man synthetic.conf'

When FSEevents reports the path of changed files, if the path involves
a synthetic firmlink, the path is reported from the point of the
synthetic firmlink and not the real path. For example:

Real path:
/System/Volumes/Data/network/working/directory/foo.txt

Synthetic firmlink:
/network -&gt; /System/Volumes/Data/network

FSEvents path:
/network/working/directory/foo.txt

This causes the FSEvents path to not match against the worktree
directory.

There are several ways in which synthetic firmlinks can be created:
they can be defined in /etc/synthetic.conf, the automounter can create
them, and there may be other means. Simply reading /etc/synthetic.conf
is insufficient. No matter what process creates synthetic firmlinks,
they all get created in the root directory.

Therefore, in order to deal with synthetic firmlinks, the root directory
is scanned and the first possible synthetic firmink that, when resolved,
is a prefix of the worktree is used to map FSEvents paths to worktree
paths.

Signed-off-by: Eric DeCosta &lt;edecosta@mathworks.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor: avoid socket location check if using hook</title>
<updated>2022-10-05T18:05:23Z</updated>
<author>
<name>Eric DeCosta</name>
<email>edecosta@mathworks.com</email>
</author>
<published>2022-10-04T17:32:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8f44976882b77bb3b9ac0579a04ef05cbea5bdb2'/>
<id>urn:sha1:8f44976882b77bb3b9ac0579a04ef05cbea5bdb2</id>
<content type='text'>
If monitoring is done via fsmonitor hook rather than IPC there is no
need to check if the location of the Unix Domain socket (UDS) file is
on a remote filesystem.

Signed-off-by: Eric DeCosta &lt;edecosta@mathworks.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor: relocate socket file if .git directory is remote</title>
<updated>2022-10-05T18:05:22Z</updated>
<author>
<name>Eric DeCosta</name>
<email>edecosta@mathworks.com</email>
</author>
<published>2022-10-04T17:32:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6beb2688d33373508610b190f04721e748caa12c'/>
<id>urn:sha1:6beb2688d33373508610b190f04721e748caa12c</id>
<content type='text'>
If the .git directory is on a remote filesystem, create the socket
file in 'fsmonitor.socketDir' if it is defined, else create it in $HOME.

Signed-off-by: Eric DeCosta &lt;edecosta@mathworks.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor: refactor filesystem checks to common interface</title>
<updated>2022-10-05T18:05:22Z</updated>
<author>
<name>Eric DeCosta</name>
<email>edecosta@mathworks.com</email>
</author>
<published>2022-10-04T17:32:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=508c1a572d633202a220f2902c0d6b4cd1678349'/>
<id>urn:sha1:508c1a572d633202a220f2902c0d6b4cd1678349</id>
<content type='text'>
Provide a common interface for getting basic filesystem information
including filesystem type and whether the filesystem is remote.

Refactor existing code for getting basic filesystem info and detecting
remote file systems to the new interface.

Refactor filesystem checks to leverage new interface. For macOS,
error-out if the Unix Domain socket (UDS) file is on a remote
filesystem.

Signed-off-by: Eric DeCosta &lt;edecosta@mathworks.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor: option to allow fsmonitor to run against network-mounted repos</title>
<updated>2022-08-12T04:03:09Z</updated>
<author>
<name>Eric DeCosta</name>
<email>edecosta@mathworks.com</email>
</author>
<published>2022-08-11T23:57:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=85dc0da6dcf21801149e747310d087abe26b2354'/>
<id>urn:sha1:85dc0da6dcf21801149e747310d087abe26b2354</id>
<content type='text'>
Though perhaps not common, there are use cases where users have large,
network-mounted repos. Having the ability to run fsmonitor against
network paths would benefit those users.

Most modern Samba-based filers have the necessary support to enable
fsmonitor on network-mounted repos. As a first step towards enabling
fsmonitor to work against network-mounted repos, introduce a
configuration option, 'fsmonitor.allowRemote'. Setting this option to
true will override the default behavior (erroring-out) when a
network-mounted repo is detected by fsmonitor.

Signed-off-by: Eric DeCosta &lt;edecosta@mathworks.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jh/builtin-fsmonitor-part3'</title>
<updated>2022-06-10T22:04:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-06-10T22:04:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9e496fffc872b20a147d7b80330335edfff919cc'/>
<id>urn:sha1:9e496fffc872b20a147d7b80330335edfff919cc</id>
<content type='text'>
More fsmonitor--daemon.

* jh/builtin-fsmonitor-part3: (30 commits)
  t7527: improve implicit shutdown testing in fsmonitor--daemon
  fsmonitor--daemon: allow --super-prefix argument
  t7527: test Unicode NFC/NFD handling on MacOS
  t/lib-unicode-nfc-nfd: helper prereqs for testing unicode nfc/nfd
  t/helper/hexdump: add helper to print hexdump of stdin
  fsmonitor: on macOS also emit NFC spelling for NFD pathname
  t7527: test FSMonitor on case insensitive+preserving file system
  fsmonitor: never set CE_FSMONITOR_VALID on submodules
  t/perf/p7527: add perf test for builtin FSMonitor
  t7527: FSMonitor tests for directory moves
  fsmonitor: optimize processing of directory events
  fsm-listen-darwin: shutdown daemon if worktree root is moved/renamed
  fsm-health-win32: force shutdown daemon if worktree root moves
  fsm-health-win32: add polling framework to monitor daemon health
  fsmonitor--daemon: stub in health thread
  fsmonitor--daemon: rename listener thread related variables
  fsmonitor--daemon: prepare for adding health thread
  fsmonitor--daemon: cd out of worktree root
  fsm-listen-darwin: ignore FSEvents caused by xattr changes on macOS
  unpack-trees: initialize fsmonitor_has_run_once in o-&gt;result
  ...
</content>
</entry>
</feed>
