<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/fsmonitor-settings.c, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-09-19T20:46:00Z</updated>
<entry>
<title>fsmonitor-settings: fix a typo</title>
<updated>2024-09-19T20:46:00Z</updated>
<author>
<name>Andrew Kreimer</name>
<email>algonell@gmail.com</email>
</author>
<published>2024-09-19T18:34:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=be645cd268c2b1b9ee2e1d12ac309e696c8999e0'/>
<id>urn:sha1:be645cd268c2b1b9ee2e1d12ac309e696c8999e0</id>
<content type='text'>
Fix a typo in comments.

Signed-off-by: Andrew Kreimer &lt;algonell@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>config: clarify memory ownership in `git_config_pathname()`</title>
<updated>2024-05-27T18:19:59Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-05-27T11:46:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6073b3b5c37716c50244d635e7c358f41f43e286'/>
<id>urn:sha1:6073b3b5c37716c50244d635e7c358f41f43e286</id>
<content type='text'>
The out parameter of `git_config_pathname()` is a `const char **` even
though we transfer ownership of memory to the caller. This is quite
misleading and has led to many memory leaks all over the place. Adapt
the parameter to instead be `char **`.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor: mark some maybe-unused parameters</title>
<updated>2023-09-18T22:56:14Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2023-09-18T22:31:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f4c5778b2dca447ae130cfab6cc9b7b614e7ec43'/>
<id>urn:sha1:f4c5778b2dca447ae130cfab6cc9b7b614e7ec43</id>
<content type='text'>
There's a bit of conditionally-compiled code in fsmonitor, so some
function parameters may be unused depending on the build options:

  - in fsmonitor--daemon.c's try_to_run_foreground_daemon(), we take a
    detach_console argument, but it's only used on Windows. This seems
    intentional (and not mistakenly missing other platforms) based on
    the discussion in c284e27ba7 (fsmonitor--daemon: implement 'start'
    command, 2022-03-25), which introduced it.

  - in fsmonitor-setting.c's check_for_incompatible(), we pass the "ipc"
    flag down to the system-specific fsm_os__incompatible() helper. But
    we can only do so if our platform has such a helper.

In both cases we can mark the argument as MAYBE_UNUSED. That annotates
it enough to suppress the compiler's -Wunused-parameter warning, but
without making it impossible to use the variable, as a regular UNUSED
annotation would.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>alloc.h: move ALLOC_GROW() functions from cache.h</title>
<updated>2023-02-24T01:25:28Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-02-24T00:09:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=36bf19589055fb71aac0ed6719dfe5b385adc2bf'/>
<id>urn:sha1:36bf19589055fb71aac0ed6719dfe5b385adc2bf</id>
<content type='text'>
This allows us to replace includes of cache.h with includes of the much
smaller alloc.h in many places.  It does mean that we also need to add
includes of alloc.h in a number of C files.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<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>
</feed>
