<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/fsmonitor-settings.c, branch v2.40.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-01-17T22:32:06Z</updated>
<entry>
<title>treewide: always have a valid "index_state.repo" member</title>
<updated>2023-01-17T22:32:06Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2023-01-17T13:57:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6269f8eaad054a02517f5e03873726e84a032d8e'/>
<id>urn:sha1:6269f8eaad054a02517f5e03873726e84a032d8e</id>
<content type='text'>
When the "repo" member was added to "the_index" in [1] the
repo_read_index() was made to populate it, but the unpopulated
"the_index" variable didn't get the same treatment.

Let's do that in initialize_the_repository() when we set it up, and
likewise for all of the current callers initialized an empty "struct
index_state".

This simplifies code that needs to deal with "the_index" or a custom
"struct index_state", we no longer need to second-guess this part of
the "index_state" deep in the stack. A recent example of such
second-guessing is the "istate-&gt;repo ? istate-&gt;repo : the_repository"
code in [2]. We can now simply use "istate-&gt;repo".

We're doing this by making use of the INDEX_STATE_INIT() macro (and
corresponding function) added in [3], which now have mandatory "repo"
arguments.

Because we now call index_state_init() in repository.c's
initialize_the_repository() we don't need to handle the case where we
have a "repo-&gt;index" whose "repo" member doesn't match the "repo"
we're setting up, i.e. the "Complete the double-reference" code in
repo_read_index() being altered here. That logic was originally added
in [1], and was working around the lack of what we now have in
initialize_the_repository().

For "fsmonitor-settings.c" we can remove the initialization of a NULL
"r" argument to "the_repository". This was added back in [4], and was
needed at the time for callers that would pass us the "r" from an
"istate-&gt;repo". Before this change such a change to
"fsmonitor-settings.c" would segfault all over the test suite (e.g. in
t0002-gitfile.sh).

This change has wider eventual implications for
"fsmonitor-settings.c". The reason the other lazy loading behavior in
it is required (starting with "if (!r-&gt;settings.fsmonitor) ..." is
because of the previously passed "r" being "NULL".

I have other local changes on top of this which move its configuration
reading to "prepare_repo_settings()" in "repo-settings.c", as we could
now start to rely on it being called for our "r". But let's leave all
of that for now, and narrowly remove this particular part of the
lazy-loading.

1. 1fd9ae517c4 (repository: add repo reference to index_state,
   2021-01-23)
2. ee1f0c242ef (read-cache: add index.skipHash config option,
   2023-01-06)
3. 2f6b1eb794e (cache API: add a "INDEX_STATE_INIT" macro/function,
   add release_index(), 2023-01-12)
4. 1e0ea5c4316 (fsmonitor: config settings are repository-specific,
   2022-03-25)

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Acked-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor: check for compatability before communicating with fsmonitor</title>
<updated>2022-10-05T18:05:23Z</updated>
<author>
<name>Eric DeCosta</name>
<email>edecosta@mathworks.com</email>
</author>
<published>2022-10-04T17:32:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=25c2cab08f90b6251b1ace91e37f05d4cb8fcd0c'/>
<id>urn:sha1:25c2cab08f90b6251b1ace91e37f05d4cb8fcd0c</id>
<content type='text'>
If fsmonitor is not in a compatible state, warn with an appropriate message.

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: 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: avoid memory leak in `fsm_settings__get_incompatible_msg()`</title>
<updated>2022-06-16T20:22:03Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-06-15T23:35:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5a09991e32f3487702bd032703bacba1c4c46612'/>
<id>urn:sha1:5a09991e32f3487702bd032703bacba1c4c46612</id>
<content type='text'>
Reported by Coverity.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor-settings: NTFS and FAT32 on MacOS are incompatible</title>
<updated>2022-05-26T22:59:26Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2022-05-26T21:47:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ddc5dacfb368d4903f5dd475897e5e11772f9970'/>
<id>urn:sha1:ddc5dacfb368d4903f5dd475897e5e11772f9970</id>
<content type='text'>
On MacOS mark repos on NTFS or FAT32 volumes as incompatible.

The builtin FSMonitor used Unix domain sockets on MacOS for IPC
with clients.  These sockets are kept in the .git directory.
Unix sockets are not supported by NTFS and FAT32, so the daemon
cannot start up.

Test for this during our compatibility checking so that client
commands do not keep trying to start the daemon.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor-settings: remote repos on macOS are incompatible</title>
<updated>2022-05-26T22:59:26Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2022-05-26T21:47:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1e7be10de0d493f471bf102a7eed32da8247c825'/>
<id>urn:sha1:1e7be10de0d493f471bf102a7eed32da8247c825</id>
<content type='text'>
Teach Git to detect remote working directories on macOS and mark them as
incompatible with FSMonitor.

With this, `git fsmonitor--daemon run` will error out with a message
like it does for bare repos.

Client commands, like `git status`, will not attempt to start the daemon.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor-settings: VFS for Git virtual repos are incompatible</title>
<updated>2022-05-26T22:59:26Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2022-05-26T21:47:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5c58fbd26579391d825cb1ef0df8703bd6fd0ed5'/>
<id>urn:sha1:5c58fbd26579391d825cb1ef0df8703bd6fd0ed5</id>
<content type='text'>
VFS for Git virtual repositories are incompatible with FSMonitor.

VFS for Git is a downstream fork of Git.  It contains its own custom
file system watcher that is aware of the virtualization.  If a working
directory is being managed by VFS for Git, we should not try to watch
it because we may get incomplete results.

We do not know anything about how VFS for Git works, but we do
know that VFS for Git working directories contain a well-defined
config setting.  If it is set, mark the working directory as
incompatible.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor-settings: stub in Win32-specific incompatibility checking</title>
<updated>2022-05-26T22:59:26Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2022-05-26T21:46:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d33c804daec8aaf1e8af187c00166ef4cb017262'/>
<id>urn:sha1:d33c804daec8aaf1e8af187c00166ef4cb017262</id>
<content type='text'>
Extend generic incompatibility checkout with platform-specific
mechanism.  Stub in Win32 version.

In the existing fsmonitor-settings code we have a way to mark
types of repos as incompatible with fsmonitor (whether via the
hook and IPC APIs).  For example, we do this for bare repos,
since there are no files to watch.

Extend this exclusion mechanism for platform-specific reasons.
This commit just creates the framework and adds a stub for Win32.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor-settings: bare repos are incompatible with FSMonitor</title>
<updated>2022-05-26T22:59:26Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2022-05-26T21:46:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=62a62a28308453ee830bb7e02cf732474a6e01a5'/>
<id>urn:sha1:62a62a28308453ee830bb7e02cf732474a6e01a5</id>
<content type='text'>
Bare repos do not have a worktree, so there is nothing for the
daemon watch.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
